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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12 Regression] bogus    |[11 Regression] bogus
                   |-Wstringop-overread warning |-Wstringop-overread warning
                   |with address sanitizer due  |with address sanitizer due
                   |to member address           |to member address
                   |substitution                |substitution
           Keywords|                            |needs-bisection
      Known to work|                            |12.0
      Known to fail|                            |11.2.1
           Priority|P3                          |P2

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
On trunk the testcase no longer reproduces the issue, it's still present on the
GCC 11 branch though.  I wonder what fixed it.

Note before .asan we have

  <bb 2> [local count: 1073741824]:
  _1 = MEM[(struct B *)pc_2(D) + 1B].i;
  pd_4(D)->i = _1;
  _9 = (sizetype) i_6(D);
  _10 = _9 * 16;
  _11 = _10 + 4;
  _12 = &MEM[(struct B *)pc_2(D) + 1B];
  psa_7 = _12 + _11;
  f (psa_7);

and after

  <bb 2> [local count: 1073741824]:
  _13 = &MEM[(struct B *)pc_2(D) + 1B].i;
  .ASAN_CHECK (6, _13, 4, 4);
  _1 = MEM[(struct B *)pc_2(D) + 1B].i;
  _14 = &pd_4(D)->i;
  .ASAN_CHECK (7, _14, 4, 4);
  pd_4(D)->i = _1;
  _9 = (sizetype) i_6(D);
  _10 = _9 * 16;
  _11 = _10 + 4;
  _12 = &MEM[(struct B *)pc_2(D) + 1B];
  psa_7 = _12 + _11;
  f (psa_7);

so I see nothing wrong.  Later FRE determines that _13 and _12 are equal
(again correct but this confuses the diagnostics).

On trunk we seem to have lowered _12 to a pointer-plus and VN fails to CSE
the addresses.  That's an optimization regression.

Reply via email to