https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102139
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> There is no PHI for a for FRE to merge even. And there is no alignment
> information on the pointers assignments either.
The only thing FRE does for this testcase which SLP might make a huge mistake
on is prop a_11(D) into the MEM.
From:
# i_24 = PHI <0(2)>
_22 = i_24 * 8;
_25 = a_11(D) + _22;
MEM[(vector(4) short unsigned int *)_25] = { 0, 0, 0, 0 };
Into:
MEM[(vector(4) short unsigned int *)a_11(D)] = { 0, 0, 0, 0 };
But SLP seems like does not take into account the two sides of the branches are
unrelated and still uses the alignment of the first for the second.
/app/example.cpp:6:10: note: recording new base alignment for a_11(D)
alignment: 2
misalignment: 0
based on: *a_11(D) = 0;
/app/example.cpp:6:10: note: recording new base alignment for a_11(D)
alignment: 8
misalignment: 0
based on: MEM[(vector(4) short unsigned int *)a_11(D)] = { 0, 0, 0, 0 };