Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!bloom-beacon!think!ames!pasteur!ucbvax!sdcsvax!ucsdhub!esosun!seismo!uunet!mcvax!ukc!its63b!aiva!richard From: richard@aiva.ed.ac.uk (Richard Tobin) Newsgroups: comp.lang.c Subject: Re: noalias; parens honored Keywords: ANSI C standard Message-ID: <236@aiva.ed.ac.uk> Date: 21 Jan 88 15:44:50 GMT References: <6829@brl-smoke.ARPA> <2845@zeus.TEK.COM> <6860@brl-smoke.ARPA> <12211@orchid.waterloo.edu> <2648@mmintl.UUCP> Reply-To: richard@uk.ac.ed.aiva (Richard Tobin) Organization: Bannerman's Bar, Cowgate, Edinburgh Lines: 20 In article <2648@mmintl.UUCP> franka@mmintl.UUCP (Frank Adams) writes: >> ((a + 1) -1) > >In this example, the rule does forbid full optimizing on many machines. >(One can still compute (a + 1), and then use a, skipping the subtraction.) What overflow behaviour does optimization have to preserve? Presumably the standard does not specify behaviour when overflow would occur, so that all you have to do is ensure that your re-arrangement doesn't cause overflow that wouldn't have happened otherwise. Optimizing the above expression to 'a' never does this. Of course, this might not be consistent with what a particular machine does with overflow, but I doubt that the standard requires consistent overflow behaviour. -- Richard Tobin, JANET: R.Tobin@uk.ac.ed AI Applications Institute, ARPA: R.Tobin%uk.ac.ed@nss.cs.ucl.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin