Path: utzoo!mnetor!uunet!ncc!alberta!att-ih!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.lang.c Subject: Re: volatiles Message-ID: <2584@ttrdc.UUCP> Date: 14 Apr 88 08:17:29 GMT References: <1394@pt.cs.cmu.edu> <1530@dataio.Data-IO.COM> <1412@pt.cs.cmu.edu> Organization: AT&T, Skokie, IL Lines: 22 In article <1412@pt.cs.cmu.edu>, edw@IUS1.CS.CMU.EDU (Eddie Wyatt) writes: # [Optimization] assumes that data flow analysis of the code # can be used to conduct dead code elimination, variable induction, # migration of loop invariants, etc. It can not when you have multi-threads # of execution with shared variable because in general any of the shared # variables may changed at any time. volatile is just a HACK to make the # optimization technique work! What optimization technique, then, would you suggest in the place of data flow analysis with "volatile" to tell the optimizer that a variable that COULD change behind its back, actually will do so? The only alternatives I can think of are showing the optimizer ALL your source code at once, which blows the concept of incremental compilation and modules all to hell (and what do you do about variables that can be modified by hardware?), or put up with a very conservative, pessimistic "optimizer." If you have something better in mind than the conventional optimizer technology you are bashing, tell us about it fella! -- |------------Dan Levy------------| Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, | an Engihacker @ | }!ttrdc!ttrda!levy | AT&T Data Systems Group | Disclaimer? Huh? What disclaimer??? |--------Skokie, Illinois--------|