diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-10-31 14:59:07 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-10-31 14:59:07 +0100 |
commit | b63cb15373bf384f1d644c4cfae0c60422cc3909 (patch) | |
tree | d7f06c9d135adae0c04310c721cd3fcef8650744 | |
parent | 1e99c6e0448f32e9490946f3821fe0c45b69b3f5 (diff) | |
download | gcc-b63cb15373bf384f1d644c4cfae0c60422cc3909.zip gcc-b63cb15373bf384f1d644c4cfae0c60422cc3909.tar.gz gcc-b63cb15373bf384f1d644c4cfae0c60422cc3909.tar.bz2 |
* gcc.dg/vect/vect-align-3.c: New test.
From-SVN: r204259
-rw-r--r-- | gcc/testsuite/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-align-3.c | 54 |
2 files changed, 56 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 769209d..261e2e2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,7 @@ 2013-10-31 Jakub Jelinek <jakub@redhat.com> + * gcc.dg/vect/vect-align-3.c: New test. + * g++.dg/warn/pr33738.C (main): Initialize a2 again to make sure we warn about it already during VRP1 pass. diff --git a/gcc/testsuite/gcc.dg/vect/vect-align-3.c b/gcc/testsuite/gcc.dg/vect/vect-align-3.c new file mode 100644 index 0000000..a8d3e48 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-align-3.c @@ -0,0 +1,54 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ + +int a[2048]; + +void +f1 (int x, int y) +{ + int i; + x &= -256; + y &= -256; + for (i = x + 256; i < y; i++) + a[i]++; +} + +void +f2 (int x, int y) +{ + int i; + if (x & 31) + __builtin_unreachable (); + if (y & 31) + __builtin_unreachable (); + for (i = x + 256; i < x + y; i++) + a[i]++; +} + +void +f3 (int x, int y) +{ + int i; + if (x % 256) + __builtin_unreachable (); + if (y % 256) + __builtin_unreachable (); + for (i = x + 256; i < x + y; i++) + a[i]++; +} + +void +f4 (int x, int y) +{ + int i; + if ((x % 256) != 0) + __builtin_unreachable (); + if ((y % 256) != 0) + __builtin_unreachable (); + for (i = x + 256; i < x + y; i++) + a[i]++; +} + +/* { dg-final { scan-tree-dump-not "vect_do_peeling_for_loop_bound" "vect" } } */ +/* { dg-final { scan-tree-dump-not "loop peeled for vectorization" "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ |