https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95169
Bug ID: 95169
Summary: i386 comparison between nan and 0.0 triggers Invalid
operation exception
Product: gcc
Version: 10.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Created attachment 48549
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48549&action=edit
testcase
Hello,
On building the attached testcase with
gcc-10 -m32 test.c -o test -march=i386 -mtune=generic -lm
its execution prints "0 1", i.e. an Invalid operation exception is raised by
the mere comparison of y (that contains NaN) against 0.0.
This was tested with Debian's gcc-10 10.1.0-1.
This does not happen with previous versions of gcc. This happens with half of
the values of -mtune (I'll attach the details) ; this also happens with
-march=i486, i586, pentium ; this does not happen with -march=i686 or
pentiumpro etc. (whatever the value of -mtune).
Samuel