Re: optimisation -O1 changes floating-point results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/18/2013 03:23 PM, Diggory Hardy wrote:

Is this a known issue?

Yes, it's the excess precision problem on i386:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323

Is it the same with later GCC versions?

GCC 4.5 has some fixes.

Is there a way I can turn on most optimisations while still getting exactly
the same results as without optimisation?

You could compile with -mfpmath=sse -msse2, or you could set the floating point control word to restrict precision to 53 bits. The latter will cover doubles only, the issue can still surface with floats.

--
Florian Weimer / Red Hat Product Security Team




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux