This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/52451] New: gcc w/i387 float generates fucom rather than fcom for floating point comparsons


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]