GCC beaten by ICC in stupid trig test!

Robert Dewar dewar@gnat.com
Thu Mar 25 07:29:00 GMT 2004


Paul Koning wrote:

> I don't have a C standard, but my copy of Harbison & Steele says what
> I expected about parentheses: "Parentheses do not necessarily force a
> particular evaluation order".  

Harbison and Steele, whether read carefully or not :-) should not be
considered a substitute for the standard.

> So as far as I can tell, by the language rules, (a+b)+c and a+(b+c)
> are the same -- they have the same ordering properties (or lack
> thereof). 

I am unaware of any authority for this statement.
> 
> Is the implication that if -fno-fast-math is in effect, parentheses
> acquire an ADDITIONAL semantic (evaluation order) that goes beyond the
> C language definition (forcing operand grouping)?

I an unaware of any authority for this statement.
> 
> Curious that C++ (at least as described in Stroustrup) *does* say that
> parentheses force evaluation order...

Not curious at all, of course parentheses control the evaluation order,
e.g. in (a+b)*c.

> 
> 	    paul



More information about the Gcc mailing list