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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And/or detect cases where doing this optimization is valid on pointers, say
&arr[0] + (x + 4)
where (&arr[0] + 4) + x is valid because the arr is array and has 4+ elements,
or &arr[1] + (x - 1) where (&arr[1] - 1) + x is valid too.  But when for
ptr + (x + cst) or ptr + (x - cst)
ptr + cst or ptr - cst aren't valid pointer arithmetics, we can only do
non-pointer arithmetics or punt.

Reply via email to