From: Richard Sandiford Date: Thu, 10 Aug 2017 19:58:16 +0000 (+0000) Subject: PR81738: Split vect-alias-check-6.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=adc840379952b3a5649417d1d20d68f0d65e60ba;p=gcc.git PR81738: Split vect-alias-check-6.c 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 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 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0c5ac58bdc9..da63e03ae44 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2017-08-10 Richard Sandiford + + 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 PR target/81736 diff --git a/gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c b/gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c index 0993c69a5bd..5bb78f8ad5c 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c +++ b/gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c @@ -12,12 +12,5 @@ f1 (struct s *a, struct s *b) 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" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-alias-check-7.c b/gcc/testsuite/gcc.dg/vect/vect-alias-check-7.c new file mode 100644 index 00000000000..812349de914 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-alias-check-7.c @@ -0,0 +1,16 @@ +/* { 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 } } } } */