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

--- Comment #6 from Rich Felker <bugdal at aerifal dot cx> 2012-03-16 14:23:09 
UTC ---
The 387 FPU ensures correct rounding for the currently selected precision mode,
which per the ABI is always extended precision.

As for the usefulness of fixing this, I found the bug while working on my
correct sqrt implementation in musl libc, because despite the existence of a
correct version of the function, I was still getting wrong results. It turned
out gcc was replacing it with a buggy builtin. I don't think "glibc gets it
wrong anyway" is a reason not to fix the problem, especially now that glibc
seems to be under new maintainership and actually fixing longstanding WONTFIX
bugs.

Folks who just care about speed and want to throw correctness away should
already be using -ffast-math and similar.

Actually since this bug is rounding-related, perhaps it would suffice to make
-frounding-math turn off the builtin sqrt when using 387 math...?

Reply via email to