+2019-11-21 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR tree-optimization/92526
+ * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Reject
+ versioning for alignment if the accesses do not have a consistent
+ mask, rather than asserting that the masks are consistent.
+
2019-11-21 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/92595
+2019-11-21 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR tree-optimization/92526
+ * gcc.target/aarch64/pr92526.c: New test.
+
2019-11-21 Richard Sandiford <richard.sandiford@arm.com>
PR testsuite/92543
--- /dev/null
+/* { dg-options "-O3 -mstrict-align" } */
+
+void
+f (unsigned int *restrict x, unsigned int *restrict y,
+ unsigned char *restrict z, unsigned int n)
+{
+ for (unsigned int i = 0; i < n % 4; ++i)
+ x[i] = x[i] + y[i] + z[i];
+}
mask must be 15 = 0xf. */
mask = size - 1;
- /* FORNOW: use the same mask to test all potentially unaligned
- references in the loop. The vectorizer currently supports
- a single vector size, see the reference to
- GET_MODE_NUNITS (TYPE_MODE (vectype)) where the
- vectorization factor is computed. */
- gcc_assert (!LOOP_VINFO_PTR_MASK (loop_vinfo)
- || LOOP_VINFO_PTR_MASK (loop_vinfo) == mask);
+ /* FORNOW: use the same mask to test all potentially unaligned
+ references in the loop. */
+ if (LOOP_VINFO_PTR_MASK (loop_vinfo)
+ && LOOP_VINFO_PTR_MASK (loop_vinfo) != mask)
+ {
+ do_versioning = false;
+ break;
+ }
+
LOOP_VINFO_PTR_MASK (loop_vinfo) = mask;
LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo).safe_push (stmt_info);
}