https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108017
Richard Biener changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed||2022-12-08
--- Comment #1 from Richard Biener ---
We do this for + C {!=,==} ' + C' - I think we're afraid of relational
compares here though, even with TYPE_OVERFLOW_UNDEFINED.
/* (+b) !=/== ([1] + c) -> sizeof(a[0]) + b !=/== c */
(for neeq (ne eq)
(simplify
(neeq (pointer_plus ADDR_EXPR@0 @1) (pointer_plus ADDR_EXPR@2 @3))
(with { poly_int64 diff; tree inner_type = TREE_TYPE (@1);}
(if (ptr_difference_const (@0, @2, ))
(neeq (plus { build_int_cst_type (inner_type, diff); } @1) @3)
that could be relaxed to general @0/@2 (at some cost) and to
relational compares with TYPE_OVERFLOW_UNDEFINED.