http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484
--- Comment #12 from Uroš Bizjak <ubizjak at gmail dot com> --- (In reply to Uroš Bizjak from comment #11) > (In reply to Paolo Carlini from comment #10) > > Maybe Uros can help. > > On an x86 target using the legacy x87 instructions and the 80-bit registers, > a load of a 64-bit or 32-bit value in memory into the 80-bit registers > counts as a format conversion and an signaling NaN input will turn into a > quiet NaN in the register format. Also, using -msse2 -mfpmath=sse on 32bit target won't help, since 32bit ABI mandates that FP values are returned in x87 register. Your test will work when compiled with "-msse2 -mfpmath=sse -mno-fp-ret-in-387". But note that -mno-fp-ret-in-387 is a compiler option that changes ABI. The ABI is just wrong for the underlying x87 hardware as far as NaNs are concerned.