public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix testsuite test cases slp-perm-[1234].c
@ 2010-07-16 18:30 Peter Bergner
  2010-07-18 18:02 ` Richard Guenther
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Bergner @ 2010-07-16 18:30 UTC (permalink / raw)
  To: gcc-patches

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 ();
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-19 17:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-16 18:30 [PATCH] Fix testsuite test cases slp-perm-[1234].c Peter Bergner
2010-07-18 18:02 ` Richard Guenther
2010-07-19 17:37   ` Peter Bergner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).