http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57994
--- Comment #23 from Paolo Carlini <paolo.carlini at oracle dot com> --- Thanks. I'm sending to the mailing list an updated version, which only proceeds with do_mpfr_arg1 when !flag_trapping_math && !flag_errno_math. About the -nan, yes by now we know well that if we don't use mpfr at compile time, __builtin_expl(-inf) for -fno-math-errno -funsafe-math-optimizations returns -nan. I think Uros has an explanation why long double is special (in PR57974)