https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122296
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=117760
Summary|[16 Regression] ICE on |[16 Regression] ICE on
|valid code at -O1 on |valid code at -O1 on
|x86_64-linux-gnu: |x86_64-linux-gnu:
|verify_gimple failed |verify_gimple failed since
| |r16-4219
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot
gnu.org
Last reconfirmed| |2025-10-16
Ever confirmed|0 |1
Keywords|needs-bisection |
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
``
/* Given two integers a and b:
(a != b) & ((a|b) != 0) -> (a != b)
(a != b) | ((a|b) != 0) -> ((a|b) != 0)
(a == b) & ((a|b) == 0) -> ((a|b) == 0)
(a == b) | ((a|b) == 0) -> (a == b)
(a != b) & ((a|b) == 0) -> false
(a == b) | ((a|b) != 0) -> true */
(simplify
(bit_and:c (ne:c @0 @1) (ne (bit_ior @0 @1) integer_zerop))
(ne @0 @1))
(simplify
(bit_ior:c (ne:c @0 @1) (ne (bit_ior @0 @1) integer_zerop))
(ne (bit_ior @0 @1) { integer_zero_node; }))
(simplify
(bit_and:c (eq:c @0 @1) (eq (bit_ior @0 @1) integer_zerop))
(eq (bit_ior @0 @1) { integer_zero_node; }))
(simplify
(bit_ior:c (eq:c @0 @1) (eq (bit_ior @0 @1) integer_zerop))
(eq @0 @1))
(simplify
(bit_and:c (ne:c @0 @1) (eq (bit_ior @0 @1) integer_zerop))
{ build_zero_cst (type); })
(simplify
(bit_ior:c (eq:c @0 @1) (ne (bit_ior @0 @1) integer_zerop))
{ build_one_cst (type); })
```
There is a few things wrong here. build_zero_cst/build_one_cst should really be
constant_boolean_node (false/true, type); because it might be a vector/signed
bool.
s/integer_zero_node/build_cst_zero (TREE_TYPE (@0))/
is the fix needed here.
r16-4219-g5193b9d250a8ec .