http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57994
--- Comment #22 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> --- (In reply to Paolo Carlini from comment #20) > Thus I clearly realize something: if we do better for mpfr, the issue > remains that if we do *not* optimize and constants are not propagated, we > issue library calls, which, for command line switches like -fno-math-errno > -funsafe-math-optimizations give incorrect nan result. Where does this nan come from? Do you mean that log(0) from the library gives nan on your machine instead of the correct -inf? For any 0 (as 0 is signed)? Are you sure that there is really a library call?