This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC and Floating-Point
- From: Vincent Lefevre <vincent+gcc at vinc17 dot org>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 25 May 2005 16:13:48 +0200
- Subject: Re: GCC and Floating-Point
- References: <1116918251.4292d1eb490f6@ssl.kss-loka.si>
On 2005-05-24 09:04:11 +0200, Uros Bizjak wrote:
> I would like to point out that for applications that crunch data
> from real world (no infinites or nans, where precision is not
> critical) such as various simulations, -ffast-math is something that
> can speed up application a lot.
But note that even when precision is not critical, you may get
consistency problems or annoying unintuitive side effects. For
instance, see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15134
where
float x = 30.0;
int main()
{
if ( 90.0/x != 3.0)
abort();
return 0;
}
fails with -ffast-math (on x86). I would not recommend it, unless
the user knows all the consequences.
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA