Xref: utzoo comp.lang.c:25908 comp.lang.c++:6464 Path: utzoo!attcan!uunet!snorkelwacker!tut.cis.ohio-state.edu!mailrus!ncar!boulder!ccncsu!ncr-fc!chuckp From: chuckp@ncr-fc.FtCollins.NCR.com (Chuck Phillips) Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: Using distributive property to optimize. Message-ID: Date: 13 Feb 90 13:56:34 GMT References: <229@altos86.Altos.COM> <1020.nlhp3@oracle.nl> <94348@linus.UUCP> <15904@haddock.ima.isc.com> Sender: news@ncr-fc.FtCollins.NCR.COM Organization: NCR Microelectronics, Ft. Collins, CO Lines: 24 In-reply-to: karl@haddock.ima.isc.com's message of 7 Feb 90 20:25:41 GMT On 7 Feb 90 20:25:41 GMT, karl@haddock.ima.isc.com (Karl Heuer) said: I forget who> Compilers should NEVER rearrange computations. Karl> As long as they get the right answer, they may; as long as it's a Karl> desirable performance improvement, they should. 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. Serious: Anyone for casting an evaluation critical expressions to type "volatile"? It's too late for ANSI C. ISO C, perhaps? Un-serious: Then again, how about: extern "forth" ? :-) Just kidding! See the smilies? -> :-) :-) :-) :-) :-) :-) :-) :-) :-) -- Chuck Phillips -- chuckp%ncr-fc.FtCollins.NCR.COM uunet!ncrlnk!ncr-sd!chuckp%ncr-fc