GCC beaten by ICC in stupid trig test!
Robert Dewar
dewar@gnat.com
Thu Mar 25 07:24:00 GMT 2004
Joe Buck wrote:
>>I'm aware of the usual examples. Do you think that we need yet another
>>fast-math flag to allow the compiler to reassociate values in
>>floating-point arithmetic? -freally-unsafe-math-optimizations perhaps?
>>Or maybe such a programmer as you describe will just turn off
>>-funsafe-math-optimizations.
>
>
> 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 .
That's an appropriate statement for Fortran, but not for other languages
like C, C++ and Ada, where a+b+c is semantically equivalent to (a+b)+c
and the reassociation is not allowed in either case.
I dislike anything being called an optimization, unsafe or not, when it
is not an optimization but in fact a distortion of required language
semantics.
More information about the Gcc
mailing list