This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix testsuite test cases slp-perm-[1234].c


Sometime recently (r161984?) the compiler is now vectorizing the
initialization loops for slp-perm.[123].c on powerpc64-linux.  I copied
the method of really disabling vectorization in the initialization loops
used in PR testsuite/44538 by adding a asm ("") into the loops we don't
want vectorized.  For safety, I did the same for the check_results loops.
Looking closer, I also noticed the loop limits for the check_results
loop were bogus for slp-perm-[34].c, so I fixed those too.

Ok for mainline?

Peter


	* gcc.dg/vect/slp-perm-1.c (main): Make sure loops aren't vectorized.
	* gcc.dg/vect/slp-perm-2.c (main): Likewise.
	* gcc.dg/vect/slp-perm-3.c (main): Likewise.  Fix loop limit.
	* gcc.dg/vect/slp-perm-4.c (main): Fix loop limit.

Index: gcc.dg/vect/slp-perm-1.c
===================================================================
--- gcc.dg/vect/slp-perm-1.c	(revision 162190)
+++ gcc.dg/vect/slp-perm-1.c	(working copy)
@@ -42,16 +42,18 @@ int main (int argc, const char* argv[])
   for (i = 0; i < N; i++)
     {
       input[i] = i%256;
-      if (input[i] > 200)
-        abort();
       output[i] = 0;
+      __asm__ volatile ("");
     }
 
   foo (input, output);
 
   for (i = 0; i < N; i++)
-     if (output[i] != check_results[i])
-       abort ();
+    {
+      if (output[i] != check_results[i])
+	abort ();
+      __asm__ volatile ("");
+    }
 
   return 0;
 }
Index: gcc.dg/vect/slp-perm-2.c
===================================================================
--- gcc.dg/vect/slp-perm-2.c	(revision 162190)
+++ gcc.dg/vect/slp-perm-2.c	(working copy)
@@ -37,16 +37,18 @@ int main (int argc, const char* argv[])
   for (i = 0; i < N; i++)
     {
       input[i] = i%256;
-      if (input[i] > 200)
-        abort();
       output[i] = 0;
+      __asm__ volatile ("");
     }
 
   foo (input, output);
 
   for (i = 0; i < N; i++)
-    if (output[i] != check_results[i])
-      abort ();
+    {
+      if (output[i] != check_results[i])
+	abort ();
+      __asm__ volatile ("");
+    }
 
   return 0;
 }
Index: gcc.dg/vect/slp-perm-3.c
===================================================================
--- gcc.dg/vect/slp-perm-3.c	(revision 162190)
+++ gcc.dg/vect/slp-perm-3.c	(working copy)
@@ -51,16 +51,18 @@ int main (int argc, const char* argv[])
   for (i = 0; i < N; i++)
     {
       input[i] = i%256;
-      if (input[i] > 200)
-        abort();
       output[i] = 0;
+      __asm__ volatile ("");
     }
 
   foo (input, output);
 
-  for (i = 0; i < N - N; i++)
-    if (output[i] != check_results[i])
-      abort ();
+  for (i = 0; i < N; i++)
+    {
+      if (output[i] != check_results[i])
+	abort ();
+      __asm__ volatile ("");
+    }
 
   return 0;
 }
Index: gcc.dg/vect/slp-perm-4.c
===================================================================
--- gcc.dg/vect/slp-perm-4.c	(revision 162190)
+++ gcc.dg/vect/slp-perm-4.c	(working copy)
@@ -74,7 +74,7 @@ int main (int argc, const char* argv[])
 
   foo (input, output);
 
-  for (i = 0; i < N - N; i++)
+  for (i = 0; i < N; i++)
     if (output[i] != check_results[i])
       abort ();
 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]