https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108447

--- 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))
Updated.
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
exception
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.

Reply via email to