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: "Dave Korn" <dk at artimi dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Wed, 24 Mar 2004 18:57:43 -0000
- Subject: RE: GCC beaten by ICC in stupid trig test!
> -----Original Message-----
> From: gcc-owner On Behalf Of Paul Brook
> Sent: 24 March 2004 18:53
> > 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
IIUIC the fact that the + operator is specified in the standard as binding
left-to-right imply that "a + b + c" with no brackets *has* to be
interpreted as "(a + b) + c".
Either that, or I'm being dumb.
cheers,
DaveK
--
Can't think of a witty .sigline today....