-ffast-math: Math critical applications?

Robin H. Johnson robbat2 at gentoo.org
Wed Oct 4 18:24:26 EDT 2006


On Wed, Oct 04, 2006 at 03:35:12PM -0400, John Richard Moser wrote:
> Currently of interest to me is applying -ffast-math generally.  This
> should not be a problem in most cases; -ffast-math only produces defects
> in floating point calculations, and the defects are apparently often
> minor enough to go unnoticed.  Critical calculations like TCP/IP packet
> size, byte offsets in files, and physical pixel locations are all
> discrete anyway and thus will all be integer.
This is a slight tangent to your original point, but it came up recently
with regards to -ffast-math, and is related to your correctness
questions below.

The one sentence background is that I'm a Gentoo developer.

In the last month, I've seen several separate Gentoo bugs filed for
cases where -ffast-math was causing incorrect operation or outright
segmentation faults - with a stable GCC.

We're putting an item into our next GWN, but a quick survey of Gentoo
developers indicated that -ffast-math has broken a lot of stuff in the
past: openssl, libmcrypt, kde-libs, openoffice, apache2, postgresql,
mpfr, gmp, nss_ldap (a subset of the complete list).

For openssl, mcrypt, mpfr and gmp, the applications had decent
testsuites, and the bug was easy to catch, but in the other cases it
wasn't caught until much later.

-- 
Robin Hugh Johnson
E-Mail     : robbat2 at gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.laptop.org/pipermail/devel/attachments/20061004/97c57bbf/attachment.sig>


More information about the Devel mailing list