re PR tree-optimization/79887 (ICE in set_uid_loop_bbs, at tree-vectorizer.c:482)
authorRichard Biener <rguenther@suse.de>
Mon, 6 Mar 2017 13:58:57 +0000 (13:58 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 6 Mar 2017 13:58:57 +0000 (13:58 +0000)
2017-03-06  Richard Biener  <rguenther@suse.de>

PR tree-optimization/79894
* tree-vectorizer.c (vectorize_loops): Set loop_vectorized_call
to NULL after folding it.

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

From-SVN: r245923

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

index 7c732a1dc77236c88074746de07153b4a994ad06..d9fc372641d6d406ae47a921b7b1a79c0c57c0a8 100644 (file)
@@ -1,3 +1,9 @@
+2017-03-06  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/79894
+       * tree-vectorizer.c (vectorize_loops): Set loop_vectorized_call
+       to NULL after folding it.
+
 2017-03-06  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/79824
index 51432932bfedb50c65c3bca82fa5020c363ad3de..35eb8183e4362d4518fe006687acdbe2ec12d329 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-06  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/79894
+       * gcc.dg/vect/pr79887.c: New testcase.
+
 2017-03-06  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/79824
diff --git a/gcc/testsuite/gcc.dg/vect/pr79887.c b/gcc/testsuite/gcc.dg/vect/pr79887.c
new file mode 100644 (file)
index 0000000..4a7d1b0
--- /dev/null
@@ -0,0 +1,14 @@
+/* Test for pr79887.  */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_condition } */
+/* { dg-additional-options "-fno-trapping-math --param vect-epilogues-nomask=1" } */
+/* { dg-additional-options "-mavx512ifma" { target x86_64-*-* i?86-*-* } } */
+
+void
+foo (float a[32], float b[2][32])
+{
+  int i;
+  for (i = 0; i < 32; i++)
+    a[i] = (b[0][i] > b[1][i]) ? b[0][i] : b[1][i];
+}
+
index a4cead78793f3a54c669f179aeafc7c6e027ca22..f928dec3d9602a222b9721e779cd9e9411512fd8 100644 (file)
@@ -651,6 +651,7 @@ vectorize_loops (void)
                                     "basic block vectorized\n");
                    fold_loop_vectorized_call (loop_vectorized_call,
                                               boolean_true_node);
+                   loop_vectorized_call = NULL;
                    ret |= TODO_cleanup_cfg;
                  }
              }
@@ -703,6 +704,7 @@ vectorize_loops (void)
        if (loop_vectorized_call)
          {
            fold_loop_vectorized_call (loop_vectorized_call, boolean_true_node);
+           loop_vectorized_call = NULL;
            ret |= TODO_cleanup_cfg;
          }