re PR tree-optimization/66419 (FAIL: gcc.target/aarch64/aapcs64/va_arg-6.c execution...
authorRichard Biener <rguenther@suse.de>
Tue, 9 Jun 2015 08:22:20 +0000 (08:22 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 9 Jun 2015 08:22:20 +0000 (08:22 +0000)
2015-06-09  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.

From-SVN: r224271

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

index 4cb644628cc23d1c8175192a4dda7e8883bd267b..c4897caab10025a72010d5a9aa06d6bb24ea16c9 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-09  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.
+
 2015-06-09  Nick Clifton  <nickc@redhat.com>
 
        * config/rl78/rl78.c (rl78_select_section): When -mes0 is active
index a51682a380105b00a53dc837e8d8e3de054fd9e7..80fba49c3de5d8c2eeb02a0bed9b923e3a7b160b 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-09  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/66419
+       * gcc.dg/vect/bb-slp-37.c: New testcase.
+
 2015-06-09  Shiva Chen  <shiva0217@gmail.com>
 
        * gcc.target/arm/stl-cond.c: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-37.c b/gcc/testsuite/gcc.dg/vect/bb-slp-37.c
new file mode 100644 (file)
index 0000000..dbbba87
--- /dev/null
@@ -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;
+}
index 9d8211e083356c7c687bc1ea67854cb6d238838a..660c8b27519a7143016599be2fa430dcba8fbac4 100644 (file)
@@ -1439,7 +1439,9 @@ vect_supported_load_permutation_p (slp_instance slp_instn)
           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)) != 1))
                {
                  subchain_p = false;
                  break;