[Bug c/52451] New: gcc w/i387 float generates fucom rather than fcom for floating point comparsons
bugdal at aerifal dot cx
gcc-bugzilla@gcc.gnu.org
Thu Mar 1 15:48:00 GMT 2012
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.
More information about the Gcc-bugs
mailing list