2015-03-05 Martin Sebor <msebor@redhat.com>
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 6 Mar 2015 18:43:24 +0000 (18:43 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 6 Mar 2015 18:43:24 +0000 (18:43 +0000)
* PR testsuite/63175
* gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c (main1): Move
checking of results into main to prevent it from getting optimized
away.
* gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221248 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c

index ede3d74..702e06b 100644 (file)
@@ -1,3 +1,11 @@
+2015-03-05  Martin Sebor  <msebor@redhat.com>
+
+       * PR testsuite/63175
+       * gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c (main1): Move
+       checking of results into main to prevent it from getting optimized
+       away.
+       * gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c: New test.
+
 2015-03-06  Wilco Dijkstra  <wilco.dijkstra@arm.com>
 
        * gcc.dg/tree-ssa/pr45685.c: Move to gcc.target/i386.
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c
new file mode 100644 (file)
index 0000000..73c0afa
--- /dev/null
@@ -0,0 +1,30 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-do compile } */
+
+#define N 16 
+
+const unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+unsigned int out[N];
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+  const unsigned int *pin = &in[1];
+  unsigned int *pout = &out[0];
+
+  /* Misaligned load.  */
+  *pout++ = *pin++;
+  *pout++ = *pin++;
+  *pout++ = *pin++;
+  *pout++ = *pin++;
+
+  return 0;
+}
+
+/* Verify that the assembly contains vector instructions alone
+   with no word loads (lw, lwu, lwz, lwzu, or their indexed forms)
+   or word stores (stw, stwu, stwx, stwux, or their indexed forms).  */
+
+/* { dg-final { scan-assembler "\t\(lxv|lvsr|stxv\)" } } */
+/* { dg-final { scan-assembler-not "\tlwz?u?x? " } } */
+/* { dg-final { scan-assembler-not "\tstwu?x? " } } */
index e1bc1a8..45046f4 100644 (file)
@@ -1,6 +1,5 @@
 /* { dg-require-effective-target vect_int } */
 
-#include <stdarg.h>
 #include "../../tree-vect.h"
 
 #define N 16 
@@ -9,12 +8,10 @@ unsigned int out[N];
 unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
 
 __attribute__ ((noinline)) int
-main1 (unsigned int x, unsigned int y)
+main1 (void)
 {
-  int i;
   unsigned int *pin = &in[1];
   unsigned int *pout = &out[0];
-  unsigned int a0, a1, a2, a3;
 
   /* Misaligned load.  */
   *pout++ = *pin++;
@@ -22,13 +19,6 @@ main1 (unsigned int x, unsigned int y)
   *pout++ = *pin++;
   *pout++ = *pin++;
 
-  /* Check results.  */
-  if (out[0] != in[1]
-      || out[1] != in[2]
-      || out[2] != in[3]
-      || out[3] != in[4])
-    abort();
-
   return 0;
 }
 
@@ -36,11 +26,17 @@ int main (void)
 {
   check_vect ();
 
-  main1 (2, 3);
+  main1 ();
+
+  /* Check results.  */
+  if (out[0] != in[1]
+      || out[1] != in[2]
+      || out[2] != in[3]
+      || out[3] != in[4])
+    abort();
 
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp2"  { xfail  vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2"  { xfail  vect_no_align } } } */
 /* { dg-final { cleanup-tree-dump "slp2" } } */
-