Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!djfiander From: djfiander@watnot.UUCP Newsgroups: comp.lang.c Subject: Re: C and floating point (optimizing compilers) Message-ID: <12840@watnot.UUCP> Date: Fri, 10-Apr-87 12:50:53 EST Article-I.D.: watnot.12840 Posted: Fri Apr 10 12:50:53 1987 Date-Received: Sat, 11-Apr-87 14:46:11 EST References: <742@instable.UUCP> Reply-To: djfiander@watnot.UUCP (David Fiander) Organization: U. of Waterloo, Ontario Lines: 23 Keywords: parentheses in expressions, optimizers In article <742@instable.UUCP> chaim@instable.UUCP (Chaim Bendelac) writes: >First, for us, the next two sequences are of course THE SAME: > > (1) x = (a+b)+c; > > (2) temp = a+b; > x = temp+c; > >The optimization technique which reduces (2) into (1) is called copy (or value) >propagation. The value of 'temp' is propagated. So, if you are worried about >the correct evaluation of (1), then writing it as (2) will not save you. Bad news: K&R state that if the user is really worried about order of evaluation, then she should use something like code fragment (2). This, rather obviously, blows any compiler which does what you describe out of the water. -- "Are you police officers?" "No ma'am, we're musicians." UUCP : {allegra,ihnp4,decvax,utzoo,clyde}!watmath!watnot!djfiander CSNET : djfiander%watnot@waterloo.CSNET