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

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the issue is that we ignore the dependence because
vect_preserves_scalar_order_p - which is correct iff we'd execute the
stmt within the vectorized loop body.  But as we discover it invariant
we hoist it, making the outcome of vect_preserves_scalar_order_p invalid.

I have a fix doing

t.c:5:17: note:   === vect_prune_runtime_alias_test_list ===
t.c:5:17: note:   can tell at compile time that a[0][1] and a[b.2_8][1] alias
t.c:7:15: missed:   not vectorized: compilation time alias: _18 = a[0][1];
a[b.2_8][1] = _20;

and then falling back to SLP vectorizing the unrolled loop as desired.

Reply via email to