[Bug middle-end/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484 Paolo Carlini changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |WONTFIX --- Comment #15 from Paolo Carlini --- Ok, thanks.
[Bug middle-end/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484 --- Comment #14 from Uroš Bizjak --- (In reply to Paolo Carlini from comment #13) > Thanks Uros, you are providing plenty of detaild which I largely ignored. > Thus, realistically, do you think this issue is largely unfixable? This issue is unfortunately unfixable. x87 and x86-32 ABI are just not designed to handle all details of IEEE 754 standard.
[Bug middle-end/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484 --- Comment #13 from Paolo Carlini --- Thanks Uros, you are providing plenty of detaild which I largely ignored. Thus, realistically, do you think this issue is largely unfixable?
[Bug middle-end/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484 --- Comment #12 from Uroš Bizjak --- (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.
[Bug middle-end/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484 --- Comment #11 from Uroš Bizjak --- (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.
[Bug middle-end/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484 Paolo Carlini changed: What|Removed |Added CC||ubizjak at gmail dot com --- Comment #10 from Paolo Carlini --- Maybe Uros can help.
[Bug middle-end/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484 --- Comment #9 from Charles L. Wilcox --- So, given a month has gone by, should I expect any response or action on this bug-report?
[Bug middle-end/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484 --- Comment #8 from Charles L. Wilcox --- FWIW, I tried this with g++ 4.8 on a 32-bit only system I have; it still produces erroneous sNaN values there: $ g++-4.8 -v Using built-in specs. COLLECT_GCC=g++-4.8 COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.8/lto-wrapper Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.8.1-1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --with-arch-32=i586 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.8.1 (Debian 4.8.1-1) $ g++-4.8 -Wall -Wextra test-signaling-nan.cpp $ ./a.out Signaling NaN for type "f" in hex is "7fe0". Signaling NaN's signaling-bit status for type "f" is set to "true". Quiet NaN for type "f" in hex is "7fc0". Quiet NaN's signaling-bit status for type "f" is set to "true". Signaling NaN for type "d" in hex is "7ffc". Signaling NaN's signaling-bit status for type "d" is set to "true". Quiet NaN for type "d" in hex is "7ff8". Quiet NaN's signaling-bit status for type "d" is set to "true".
[Bug middle-end/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484 Paolo Carlini changed: What|Removed |Added CC||rguenth at gcc dot gnu.org Component|c++ |middle-end --- Comment #7 from Paolo Carlini --- middle-end seems more appropriate. Richard, can you help me triaging this? Thanks in advance.