Xref: utzoo comp.lang.c:25921 comp.lang.c++:6472 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!spdcc!mirror!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: Using distributive property to optimize. Message-ID: <15944@haddock.ima.isc.com> Date: 14 Feb 90 22:02:26 GMT References: <229@altos86.Altos.COM> <1020.nlhp3@oracle.nl> <94348@linus.UUCP> <15904@haddock.ima.isc.com> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Followup-To: comp.lang.c Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 17 In article chuckp@ncr-fc.FtCollins.NCR.com (Chuck Phillips) writes: >Agreed. In the spirit of C, the compiler _should_, by default, have the >freedom to rearrange an expression (take advantage of distributivity, etc.). >However, there are times when you _really need_ to explicitly control the >order and means of evaluation. Please describe such a circumstance. I believe that all such are covered by the new ANSI C rules%, and hence there is no need for extensions like your proposed "cast-to-volatile". Karl W. Z. Heuer (karl@ima.ima.isc.com or harvard!ima!karl), The Walking Lint Followups to comp.lang.c only; this isn't really C++ related. ________ % Briefly, the rule is that the implementation is permitted to rearrange only through the grace of the as-if rule: i.e., only if the result obtained is indistinguishable from that of the abstract machine. Lvalues with the "volatile" attribute must be loaded and stored as per the abstract machine.