This is the mail archive of the
mailing list for the GCC project.
Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- To: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- Subject: Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- From: Tim Hollebeek <tim at hollebeek dot com>
- Date: Wed, 1 Aug 2001 12:24:17 -0400
- Cc: Gabriel Dos Reis <gdr at codesourcery dot com>, dewar at gnat dot com, amylaar at redhat dot com, aoliva 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
- References: <email@example.com> <200108011555.f71Ft4q07786@mururoa.inria.fr>
- Reply-To: tim at hollebeek dot com
> While I agree that by default the compiler must follow "good rules", I
> think that always disallowing optimisations which may lose some bits of
> accuracy (when specified with a option switch of course) just because
> it may hurt someone, somewhere, sometime is a little too strong.
> Full safety is IMHO impossible with floating point... Only the
> programmer knows the accuracy of its input data (Linus called that
> noise) and the accuracy he expects on its result.
Exactly ... and it isn't at all rare that the programmer knows exactly
how much noise is in the input data (little or none) and the how much
accuracy he expects in the result (as much as possible!).
Rewriting the programmers program in such a way that he gets
significantly less accuracy than he could reasonably expect is just
Noise is a red herring. There is no reason why computation should
introduce more innaccuracy than they need to, especially in a ad hoc
way that is beyond the programmer's control.