https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104162
Bug ID: 104162
Summary: [12 Regression] Missed CSE after lowering of
&MEM[ptr_1 + CST]
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
In the testcase of PR99673 we can see
<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 = pc_2(D) + 1;
psa_7 = _12 + _11;
f (psa_7);
and FRE5 is not CSEing _12 to _13.