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: unassig...@gcc.gnu.org
        ReportedBy: bug...@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.

Reply via email to