volatiles

Daniel R. Levy levy at ttrdc.UUCP
Thu Apr 14 18:17:29 AEST 1988


In article <1412 at pt.cs.cmu.edu>, edw at 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 @        |  	<most AT&T machines>}!ttrdc!ttrda!levy
|     AT&T Data Systems Group    |  Disclaimer?  Huh?  What disclaimer???
|--------Skokie, Illinois--------|



More information about the Comp.lang.c mailing list