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!
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Joe Buck <Joe dot Buck at synopsys dot COM>
- Cc: Bradley Lucier <lucier at math dot purdue dot edu>, roger at eyesopen dot com, gdr at integrable-solutions dot net, gcc at gcc dot gnu dot org, abraham at dina dot kvl dot dk, gcc-patches at gcc dot gnu dot org, laurent at guerby dot net, fjahanian at apple dot com
- Date: Wed, 24 Mar 2004 22:00:31 +0100
- Subject: Re: GCC beaten by ICC in stupid trig test!
- Organization: Moene Computational Physics, Maartensdijk, NL
- References: <13661448-7DC0-11D8-817F-000A958F150A@math.purdue.edu> <20040324105146.A1279@synopsys.com> <EDB6EC7E-7DC4-11D8-817F-000A958F150A@math.purdue.edu> <20040324110433.A2050@synopsys.com>
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.
If you don't write the parentheses, you leave it up to the compiler to
find the most convenient sequence of computations.
Dave Korn wrote:
> 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".
No, it establishes the way the multi-operator expressions may be
combined *for interpretation*. I.e., what the expression means (on a
high level, before applying such rules as 1.4 (6) [This standard does
not specify] ... the method of rounding, approximating or computing
numeric values on a particular processor").
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)