public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fix PR66419
Date: Mon, 08 Jun 2015 14:59:00 -0000	[thread overview]
Message-ID: <alpine.LSU.2.11.1506081654090.30088@zhemvz.fhfr.qr> (raw)


This fixes PR66419.

Bootstrap / regtest running on x86_64-unknown-linux-gnu.

Richard.

2015-06-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/66419
	* tree-vect-slp.c (vect_supported_load_permutation_p): Properly
	consider GROUP_GAP when detecting a perfect subchain.

	* gcc.dg/vect/bb-slp-37.c: New testcase.

Index: gcc/tree-vect-slp.c
===================================================================
--- gcc/tree-vect-slp.c	(revision 224221)
+++ gcc/tree-vect-slp.c	(working copy)
@@ -1444,7 +1459,9 @@ vect_supported_load_permutation_p (slp_i
           next_load = NULL;
           FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), j, load)
             {
-              if (j != 0 && next_load != load)
+              if (j != 0
+		  && (next_load != load
+		      || GROUP_GAP (vinfo_for_stmt (load)) != 0))
 		{
 		  subchain_p = false;
 		  break;
Index: gcc/testsuite/gcc.dg/vect/bb-slp-37.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/bb-slp-37.c	(revision 0)
+++ gcc/testsuite/gcc.dg/vect/bb-slp-37.c	(working copy)
@@ -0,0 +1,32 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+
+int a[16];
+int b[4];
+
+void __attribute__((noinline))
+foo (void)
+{
+  b[0] = a[0];
+  b[1] = a[4];
+  b[2] = a[8];
+  b[3] = a[12];
+}
+
+int main()
+{
+  int i;
+  check_vect ();
+  for (i = 0; i < 16; ++i)
+    {
+      a[i] = i;
+      __asm__ volatile ("");
+    }
+  foo ();
+  if (b[0] != 0 || b[1] != 4 || b[2] != 8 || b[3] != 12)
+    abort ();
+  return 0;
+}

                 reply	other threads:[~2015-06-08 14:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=alpine.LSU.2.11.1506081654090.30088@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --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).