http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57994
--- Comment #16 from Paolo Carlini <paolo.carlini at oracle dot com> --- Uhm, something isn't going as planned. If I change that check in do_mpfr_arg1 to !real_isnan (ra), then we always fold __builtin_expl(-__builtin_huge_vall()) to an exact 0. However, with *both* -fno-math-errno -funsafe-math-optimizations we don't fold the kind of code we really care about: type num = __builtin_logl(0.0L); type res = __builtin_expl(num); and res turns out to be -nan :( Probably the problem has to do with the log, not sure yet.