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!


> Well, first this (transforming (a+b)+c to a+(b+c)) would be a question
> of if the language standard permits this.  After this, I personally
> would like to have a way to override associativity, and I cannot see
> a clearer way as to write (a+b)+c instead of a+b+c.  But that may be a
> language standard question again.  If (a+b)+c doesn't do it, I cannot
> see another way of really forcing evaluation order.

The Fortran standard specifies that you can reorder a+b+c, but not (a+b)+c. 
Basically you must preserve paretheses, anything else is fair game. The exact 
wording is "any mathematically equivalent expression". I don't know what the 
C standard specifies on this issue.

We don't currently have a way of representing this. We're either overly 
conservative, or violate the standard.

Paul


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