https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103964
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- And for the curious it's indeed static bool indirect_ref_may_alias_decl_p (tree ref1... ... /* If only one reference is based on a variable, they cannot alias if the pointer access is beyond the extent of the variable access. (the pointer base cannot validly point to an offset less than zero of the variable). ??? IVOPTs creates bases that do not honor this restriction, so do not apply this optimization for TARGET_MEM_REFs. */ if (TREE_CODE (base1) != TARGET_MEM_REF && !ranges_maybe_overlap_p (offset1 + moff, -1, offset2, max_size2)) return false; the IVOPTs reference is likely due to the fact that while IVOPTs uses uintptrs to create the base pointer the TARGET_MEM_REF contained arithmetic itself is still considered pointer arithmetic (like also here the embedded MEM_REF pointer offsetting) and the base "pointer" cannot be a non-pointer to disable that behavior. Not a bug btw. There's no flag to make violating the C pointer offsetting rules well-defined.