This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- To: dewar at gnat dot com
- Subject: Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 31 Jul 2001 06:11:15 +0200
- Cc: aoliva at redhat dot com, gdr at codesourcery dot com, amylaar at redhat dot com, gcc at gcc dot gnu dot org, moshier at moshier dot ne dot mediaone dot net, torvalds at transmeta dot com, tprince at computer dot org
- Organization: CodeSourcery, LLC
- References: <20010731035353.271D3F2B65@nile.gnat.com>
dewar@gnat.com writes:
| <<The C/C++ Standard, for example, say that a/b/c is evaluated as
| (a/b)/c. Someone proposed that it should be evaluated as a/(b*c)
| -- which of course is incorrect -- when optimizing.
| >>
|
| Well now, let's be a little careful here ....
|
| When the C standard says a/b/c is evaluated as (a/b)/c, it means that the
| result is *as if* it were computed that way, and a compiler is of course
| free to compute a/(b*c) if the result is still correct.
Completely agreed.
[...]
| So the "which of course is incorrect" is a bit too glib here.
What I intended to mean is that the compiler has, first, to prove that
such transformmation yields the same result. The only argument I've
seen so far is that, GCC should make the program run fast...
-- Gaby