https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122307
Bug ID: 122307
Summary: FP compare reverse of LTGT and UNEQ should return
UNKNOWN
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: estupachenko at tachyum dot com
Target Milestone: ---
Should make LTGT and UNEQ not reversible. Because LTGT is signaling and UNEQ is
quiet. That property will be lost during negation and it is against IEEE rules.
Current state in jump.cc (eversed_comparison_code_parts):
...
case ORDERED:
case UNORDERED:
case LTGT:
case UNEQ:
/* In case we already see unordered comparison, we can be sure to
be dealing with floating point so we don't need any more tests. */
return reverse_condition_maybe_unordered (code);
...
However LTGT is signaling, but UNEQ is not. Unlike ORDERED/UNORDERED which are
both not signaling. To follow IEEE standard ORDERED/UNORDERED are reversible,
but LTGT or UNEQ will loose their signaling/non-signaling property after
reverse.