public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Peter Bergner <bergner@vnet.ibm.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH] Fix testsuite test cases slp-perm-[1234].c
Date: Fri, 16 Jul 2010 18:30:00 -0000	[thread overview]
Message-ID: <1279304978.3166.1105.camel@otta> (raw)

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


             reply	other threads:[~2010-07-16 18:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-16 18:30 Peter Bergner [this message]
2010-07-18 18:02 ` Richard Guenther
2010-07-19 17:37   ` Peter Bergner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279304978.3166.1105.camel@otta \
    --to=bergner@vnet.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).