This happens in gcc.dg/vect/vect-96.c and gcc.dg/vect/no-vfa-vect-43.c. In the first, we can't distinguish between a write through a (local) pointer to a global array (which is a field in a struct), and a read from a local array. s a result we vectorize the loop using loop-versioning controled by a run-time aliasing test, which also means we'll use versioning instead of peeling to align a misaligned store.
In the second, we can't tell that reads through a pointer (which is a function argument) do not overlap with a write to a local array. As a result we try to vectorize the loop using loop-versioning controled by a run-time aliasing test, however this testcase doe not allow that (--param vect-max-version-for-alias-checks=0), so vectorization fails. -- Summary: [alias-improvements-branch] can't alias ptr and local array Product: gcc Version: unknown Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dorit at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37699