[Bug tree-optimization/106131] [10/11/12/13 Regression] -fstrict-aliasing breaks normal program that does not use any pointer or reference

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 30 08:31:00 GMT 2022


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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the issue is in processing

  x = MEM[(const struct Pair &)_11];
  _47 = MEM[(const int &)&x + 4];

where we when visiting the def for 'x' continue the lookup with an
effective MEM[(const struct Pair &)_11 + 4]; but that looks for a store
of TBAA 'Pair' where we then correctly determine that _7->b = _46;
doesn't possibly alias.

A conservative fix restoring behavior before the relevant change is to
force alias set zero (no TBAA) for the offsetted lookup.


More information about the Gcc-bugs mailing list