https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101590
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-07-27
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot
gnu.org
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> it doesn't even have to be -N, any unsigned & N <= unsigned
Here are the ones which are valid:
U | N < U -> false
U & N <= U -> true
U & N > U -> false
U | N >= U -> true
(for cmp (LT GE)
(simplify
(cmp (bit_ior @0 INTEGER_CST@1) @0)
({ constant_boolean_node (cmp == GE, type); })))
(for cmp (LE GT)
(simplify
(cmp (bit_and @0 INTEGER_CST@1) @0)
({ constant_boolean_node (cmp == LE, type); })))
I don't see an easy way to combine these two patterns though.