https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66090
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jsm28 at gcc dot gnu.org
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
The testcase computes ptr + 1024 which evaluates to zero (even without IVOPTs
coming into play). This invokes undefined behavior as even if you consider
ptr + 1024 being "one after the last array element and not dereferenced"
(the NULL pointer is special in C, if you want to lift this restriction you
need to provide -fno-delete-null-pointer-checks).
Joseph may be able to provide more C standard legalise wording here. But it's
certainly how the middle-end works.