]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gcc.dg/vect/vect-align-3.c: New test.
authorJakub Jelinek <jakub@redhat.com>
Thu, 31 Oct 2013 13:59:07 +0000 (14:59 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 31 Oct 2013 13:59:07 +0000 (14:59 +0100)
From-SVN: r204259

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/vect-align-3.c [new file with mode: 0644]

index 769209d795ac1d7010dbd1611c145e93e846d60e..261e2e2c8b4acf1195bceb81443a1fb885bfd823 100644 (file)
@@ -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 (file)
index 0000000..a8d3e48
--- /dev/null
@@ -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" } } */