This is the mail archive of the
mailing list for the GCC project.
Re: How bad is fast-math?
----- Original Message -----
From: "Michael Meissner" <firstname.lastname@example.org>
To: "Jean Francois Martinez" <email@example.com>
Sent: Tuesday, May 29, 2001 4:02 PM
Subject: Re: How bad is fast-math?
> On Wed, May 30, 2001 at 12:25:50AM +0200, Jean Francois Martinez wrote:
> > According to the doc fast-math generates incorrect code. Has the
> > changed? In case it has doc should be updated, in case it hasn't name
> > should be changed and become something derogatory since there are
> > see the fast in fast-math and use it without further investigation.
> > being used in aLinux distribution and I have seen it recommended in a
> > magazine
> In general, it depends on what you consider the correct code to be :-)
> If your code never encounters infinities and denormals, and never passes
> of range argument to an intrinsic function, then -ffast-math will
> generate faster code on some machines. I can't say how well that matches
> with the numeric code out there. I would imagine many codes don't stray
> these dark corners (but then again, many do go into that territory).
-ffast-math has adverse implications IMHO in the glibc mathinline.h but you
can correct that yourself by substituting a saner version. As far as gcc
itself is concerned, I am well satisfied with the present implementation of
it, as it makes only those changes which are necessary for efficient
comparisons, sqrt() and the like. If you wish to handle NaN's, you must
leave it off, but you should be able to isolate your NaN handlers to
separately compiled modules.