This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52451] New: gcc w/i387 float generates fucom rather than fcom for floating point comparsons
- From: "bugdal at aerifal dot cx" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Mar 2012 15:25:49 +0000
- Subject: [Bug c/52451] New: gcc w/i387 float generates fucom rather than fcom for floating point comparsons
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52451
Bug #: 52451
Summary: gcc w/i387 float generates fucom rather than fcom for
floating point comparsons
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: bugdal@aerifal.cx
The C comparison operators (as opposed to the isgreater, etc. macros) are
specified to correspond to the IEEE "unordered-signaling predicates" which
raise the INVALID exception on comparisons involving a NaN (quiet or
signaling). However, gcc on x86 is generating the FUCOM opcode rather than
FCOM, which does not raise any exception unless it encounters a signaling NaN.
Apparently this is a regression since ancient versions of gcc, which correctly
generated FCOM.
This bug report is i387-specific; I have no idea if the same issue applies with
SSE math or non-x86-family cpu archs.