The second loop in the testcase only vectorises if we can reverse
a vector and if aligned loads aren't required.
2017-08-10 Richard Sandiford <richard.sandiford@linaro.org>
gcc/testsuite/
PR testsuite/81738
* gcc.dg/vect/vect-alias-check-6.c: Move second function to...
* gcc.dg/vect/vect-alias-check-7.c: ...this new file. Require
vect_perm and vect_element_align for vectorization.
From-SVN: r251037
+2017-08-10 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR testsuite/81738
+ * gcc.dg/vect/vect-alias-check-6.c: Move second function to...
+ * gcc.dg/vect/vect-alias-check-7.c: ...this new file. Require
+ vect_perm and vect_element_align for vectorization.
+
2017-08-10 H.J. Lu <hongjiu.lu@intel.com>
PR target/81736
a->x[i + 1] += b->x[i];
}
-void
-f2 (struct s *a, struct s *b)
-{
- for (int i = 0; i < N; ++i)
- a->x[i] += b->x[N - i - 1];
-}
-
-/* { dg-final { scan-tree-dump-times {checking that [^\n]* and [^\n]* have different addresses} 2 "vect" } } */
-/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */
+/* { dg-final { scan-tree-dump {checking that [^\n]* and [^\n]* have different addresses} "vect" } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#define N 16
+
+struct s { int x[N]; };
+
+void
+f1 (struct s *a, struct s *b)
+{
+ for (int i = 0; i < N; ++i)
+ a->x[i] += b->x[N - i - 1];
+}
+
+/* { dg-final { scan-tree-dump {checking that [^\n]* and [^\n]* have different addresses} "vect" } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_perm && vect_element_align } } } } */