This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GCC beaten by ICC in stupid trig test!
Toon Moene <toon@moene.indiv.nluug.nl> writes:
| Joe Buck wrote:
|
| > No. Why would we need such a thing? If the user does not care about
| > order of evaluation, the user can write a+b+c . As someone said, right
| > now we can't tell the difference between a+b+c; if we turn it into GIMPLE
| > and make t1 = a+b; 52 = t1+c; we can't tell if the user initially wrote
| > (a+b)+c or a+b+c.
|
| This is true as far as Fortran is concerned (I cannot speak for other
| languages).
|
| A+B+C means that the compiler could either evaluate (A+B)+C or A+(B+C)
| or (A+C)+B.
The C++ standard clearly says that re-association is permitted only if
the re-associated expression gives the same result as the original.
So A+B+C really is (A+B)+C.
-- Gaby