[Bug tree-optimization/108447] [13 Regression] glibc math/test-*-iseqsig failures

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 18 17:54:14 GMT 2023


--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This one started with r13-1933-g24012539ae3410174.
I think the problem is in:

Folding statement: _3 = cmp1_10 & cmp2_11;
Not folded
Folding statement: if (_3 != 0)
 Registering value_relation (x_8(D) <= y_9(D)) on (2->3)
 Registering value_relation (x_8(D) >= y_9(D)) on (2->3)
    Intersecting with existing (x_8(D) <= y_9(D)) to produce (x_8(D) == y_9(D))
and later
Folding statement: _1 = cmp1_10 | cmp2_11;
  Relation adjustment: cmp1_10  and cmp2_11  combine to produce [irange] _Bool
[1, 1]
Queued stmt for removal.  Folds to: 1

When NANs are honored, the above is not true for floating point comparisons.
x <= y and x >= y comparisons are signaling (if either operand is qNaN or
sNaN), x == y and x != y aren't (they only signal if either operand is sNaN),
and while
x <= y && x >= y implies that x == y will be true (but the former will raise
on qNaN while the latter wouldn't), if !(x <= y && x >= y) means (with
different exceptions) that x != y, which is either x is uncomparable to y
(either is NaN), or
x is finite/infinite but different from finite/infinite y.
To me the above looks like implying from x_8(D) != y_9(D) (which is the case in
bb 4
where _3 != 0 was false) that (x <= y) | (x >= y) will be true.

More information about the Gcc-bugs mailing list