Sent from my iPhone

On Mar 8, 2009, at 3:26 PM, Sylvain Pion <sylvain.p...@sophia.inria.fr> wrote:

Joseph S. Myers a écrit :
On Sun, 8 Mar 2009, Sylvain Pion wrote:
http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00104.html
introduced the -frounding-math option, and changed
the default behavior of GCC to optimize "unsafely".
That is a misleading description. The cautionary text added by that patch is still present:
   This option is experimental and does not currently guarantee to
   disable all GCC optimizations that are affected by rounding mode.
This is still true. GCC did not before the patch, did not after the patch and does not now fully support disabling optimizations that are unsafe in the presence of rounding mode changes; a few affected optimizations are disabled, but noone has seriously attempted to cover them all. GCC was "unsafe" before the patch and remains so whether or not you use the option.

You are playing with words.  Please step back and look at the facts
for a moment.

The fact is that Roger's patch introduced a regression (this word
should be clear enough here), in that some users now have their old
code broken, and they are forced to add the -frounding-math option
(after having lost some time finding about this non trivial issue).
This is a long term hindrance.

Actually before roger's patch the default is the same. Just there was no way to turn it off.



Even if -frounding-math is not 100% correct, it makes things work
(more precisely, lack of it breaks code), and this is the only
thing that matters here.


I am tired of waiting for a solution in GCC,
http://gcc.gnu.org/faq.html#support
There are plenty of bug reports for floating-point issues, and a lack of volunteers fixing them, so perhaps you should not expect filing more bugs to help, but "waiting for a solution" isn't listed there at all.

Thanks for this first-level hotline support reply.
You should probably learn to whom you are replying to.
In particular, I did send patches to GCC several times,
look at the changelogs.  I know what this is all about.
And I know that it is beyond my time availability to learn
enough to contribute patches for big things like supporting
this pragma.  I nevertheless try to find grants for funding
people to implement some related things in GCC.  And I also
contribute time to help in the guidance of GCC with my
expertise in this particular area, even if it requires a lot
of time to convince people.  So, please...


I'm willing to contribute a patch that changes the default,
if this pleases you.  It will take me 30 minutes, and would
take only 5 for a professional GCC developers since I have
to setup the environment.

The hard part, the most time consuming part here, is the discussion
on the rationale, which is why I ended up with the decision of
sending this mail rather than a patch directly.


Moreover, when reading Roger's mail I refered to, it explicitly
said that support for the pragma was "intended to come next".
So "waiting for a fix" was what I was supposed to do, once this
patch went in GCC, that introduced a regression.



Somehow, I also think that this -fno-rounding-math default is
inconsistent with the general policy of defaults in GCC which
is to aim at safety and correctness first.
The default is in accordance with standard requirements, and more more conservative than other compilers which tend to enable their - ffast-math equivalents by default rather than just -fno-rounding- math.

At least these others have chosen to do it more consistently.
They don't claim their default is anything sane at all for
serious FP computations, which at least is clear.

Moreover, standards are not perfect.  In particular, in this area,
C++ doesn't say much (I don't care about C, which lacks way too many
necessary features for serious general scientific programming anyway).
C++0x currently adopts C99's fesetround() without the pragma, so it's
in an inconsistent state.  I nevertheless try to have this fixed
properly before C++0x is out (I was at Summit last week to defend
my N2811 paper around precisely this issue, for example).

Moreover, standards are far from saying anything about the best default
for -frounding-math, it's a GCC matter.  And GCC maintainers should
be able to listen to expert users to help them making good choices.

--
Sylvain Pion
INRIA Sophia-Antipolis
Geometrica Project-Team
CGAL, http://cgal.org/

Reply via email to