This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC beaten by ICC in stupid trig test!
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>,Robert Dewar <dewar at gnat dot com>, Joe Buck <Joe dot Buck at synopsys dot COM>,Toon Moene <toon at moene dot indiv dot nluug dot nl>,Laurent GUERBY <laurent at guerby dot net>,Gabriel Dos Reis <gdr at integrable-solutions dot net>,Per Abrahamsen <abraham at dina dot kvl dot dk>
- Date: Wed, 24 Mar 2004 18:52:55 +0000
- Subject: Re: GCC beaten by ICC in stupid trig test!
- Organization: CodeSourcery
- References: <20040315160650.7DFD7F2D9C@nile.gnat.com> <4061D28D.8030207@gnat.com> <4061D5D8.5010400@tat.physik.uni-tuebingen.de>
> 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