https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77832
Bug ID: 77832 Summary: isnan() check causes signal 8 with signaling nans Product: gcc Version: 6.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gmc at synopsys dot com Target Milestone: --- Created attachment 39741 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39741&action=edit test program The example prog shows incorrect isnan() behavior when used with signaling NaNs. (isnan() itself should not generate a signal AFAIK) Run the test prog is run with a SINGLE argument(0 => use quiet Nan ; 1 => use signaling Nan): - quite NaNs behave as expected - for signaling NaNs: - the optimized exe behaves correctly and does NOT trigger a signal - the debug exe gets signal 8 on the isnan() If you then run the exact same program with an additional arg (any old value) then the optimized exe will now ALSO trigger a signal on isnan() . Attachment 'run' runs the test prog in each of these variants - none are expected to signal. OS: RedHat 6.6 Works with GCC version 5.4 Does not work on GCC versions 6.1 and 6. Compiler is built as follows: $ g++ -v Using built-in specs. COLLECT_GCC=/remote/sweifs/PST/gmc/Gnu/GCC_6.2.0/bin/g++ COLLECT_LTO_WRAPPER=/remote/sweifs/PST/gmc/Gnu/GCC_6.2.0/libexec/gcc/x86_64-redhat-linux/6.2.0/lto-wrapper Target: x86_64-redhat-linux Configured with: ../src/gcc-6.2.0/configure --prefix=/remote/sweifs/PST/gmc/Gnu/GCC_6.2.0 --enable-bootstrap --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,fortran --disable-libgcj --with-cpu=generic --build=x86_64-redhat-linux Thread model: posix gcc version 6.2.0 (GCC)