]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2015-11-23 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Nov 2015 08:36:59 +0000 (08:36 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Nov 2015 08:36:59 +0000 (08:36 +0000)
PR tree-optimization/68445
* tree-vect-slp.c (vect_create_mask_and_perm): Properly use
two different strides.

* gcc.dg/vect/pr68445.c: New testcase.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr68445.c [new file with mode: 0644]
gcc/tree-vect-slp.c

index 22cf2bd85faae105903a519a0858f74569f41f7a..f2c7f5af8fd18c4bbfb231a122dcd1f72631f458 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-23  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/68445
+       * tree-vect-slp.c (vect_create_mask_and_perm): Properly use
+       two different strides.
+
 2015-11-23  Robin Dapp  <rdapp@linux.vnet.ibm.com>
 
         * config/s390/s390.h: Add new symref flags, _NOTALIGN2 etc.
index 7a2484cd0a43bcd9d73ad4cd9b9dae0a730ea0d2..fd35568d410869ed2ebcedb296076ff56753476b 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-23  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/68445
+       * gcc.dg/vect/pr68445.c: New testcase.
+
 2015-11-23  Robin Dapp  <rdapp@linux.vnet.ibm.com>
 
         * gcc.target/s390/load-relative-check.c: New test to check
diff --git a/gcc/testsuite/gcc.dg/vect/pr68445.c b/gcc/testsuite/gcc.dg/vect/pr68445.c
new file mode 100644 (file)
index 0000000..e2b0c01
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void IMB_double_fast_x (int *destf, int *dest, int y, int *p1f)
+{
+  int i;
+  for (i = y; i > 0; i--)
+    {
+      *dest++ = 0;
+      destf[0] = destf[4] = p1f[0];
+      destf[1] = destf[5] = p1f[1];
+      destf[2] = destf[6] = p1f[2];
+      destf[3] = destf[7] = p1f[3];
+      destf += 8;
+      p1f += 4;
+    }
+}
+
+/* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" } } */
index 704f42fd886c7db636e20ecf2c71e4cf4f93e357..446ef984064216dd4b74ca27ea02856eeb187685 100644 (file)
@@ -3177,10 +3177,11 @@ vect_create_mask_and_perm (gimple *stmt,
 {
   tree perm_dest;
   gimple *perm_stmt = NULL;
-  int i, stride;
+  int i, stride_in, stride_out;
   tree first_vec, second_vec, data_ref;
 
-  stride = SLP_TREE_NUMBER_OF_VEC_STMTS (node) / ncopies;
+  stride_out = SLP_TREE_NUMBER_OF_VEC_STMTS (node) / ncopies;
+  stride_in = dr_chain.length () / ncopies;
 
   /* Initialize the vect stmts of NODE to properly insert the generated
      stmts later.  */
@@ -3202,10 +3203,11 @@ vect_create_mask_and_perm (gimple *stmt,
       vect_finish_stmt_generation (stmt, perm_stmt, gsi);
 
       /* Store the vector statement in NODE.  */
-      SLP_TREE_VEC_STMTS (node)[stride * i + vect_stmts_counter] = perm_stmt;
+      SLP_TREE_VEC_STMTS (node)[stride_out * i + vect_stmts_counter]
+       = perm_stmt;
 
-      first_vec_indx += stride;
-      second_vec_indx += stride;
+      first_vec_indx += stride_in;
+      second_vec_indx += stride_in;
     }
 }