re PR tree-optimization/85793 ([AARCH64] ICE in verify_gimple during GIMPLE pass...
authorBin Cheng <bin.cheng@arm.com>
Thu, 17 May 2018 11:25:43 +0000 (11:25 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Thu, 17 May 2018 11:25:43 +0000 (11:25 +0000)
PR tree-optimization/85793
* tree-vect-stmts.c (vectorizable_load): Handle 1 element-wise load
for VMAT_ELEMENTWISE.

gcc/testsuite
* gcc.dg/vect/pr85793.c: New test.

Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r260317

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

index 9e22926fba7d9b1765865f79f319da9926952e24..b80d6be1357d1d13f394e0764d98fd9d48e8a319 100644 (file)
@@ -1,3 +1,10 @@
+2018-05-17  Bin Cheng  <bin.cheng@arm.com>
+           Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/85793
+       * tree-vect-stmts.c (vectorizable_load): Handle 1 element-wise load
+       for VMAT_ELEMENTWISE.
+
 2018-05-17  Richard Sandiford  <richard.sandiford@linaro.org>
 
        * internal-fn.h (lookup_internal_fn): Declare
index c20e717ed97e38ced7ea1f7490612e02b406a889..69a899840ddb461b9f73da4ff79272fba046d686 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-17  Bin Cheng  <bin.cheng@arm.com>
+
+       PR tree-optimization/85793
+       * gcc.dg/vect/pr85793.c: New test.
+
 2018-05-17  Richard Sandiford  <richard.sandiford@linaro.org>
 
        * gcc.dg/gimplefe-28.c: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/pr85793.c b/gcc/testsuite/gcc.dg/vect/pr85793.c
new file mode 100644 (file)
index 0000000..9b5d518
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_perm } */
+
+int a, c, d;
+long b[6];
+void fn1() {
+  for (; a < 2; a++) {
+    c = 0;
+    for (; c <= 5; c++)
+      d &= b[a * 3];
+  }
+}
index a90c9349735493c7c87903f921aa1490d3f9ad25..4539f6a160ecb8930b0e48ce7524f5ab8bfbe7ee 100644 (file)
@@ -7801,6 +7801,10 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
            }
          ltype = build_aligned_type (ltype, TYPE_ALIGN (TREE_TYPE (vectype)));
        }
+      /* Load vector(1) scalar_type if it's 1 element-wise vectype.  */
+      else if (nloads == 1)
+       ltype = vectype;
+
       if (slp)
        {
          /* For SLP permutation support we need to load the whole group,