This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC beaten by ICC in stupid trig test!


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]