re PR tree-optimization/88071 (ICE: verify_gimple failed (error: dead STMT in EH...
authorJakub Jelinek <jakub@redhat.com>
Mon, 19 Nov 2018 14:44:08 +0000 (15:44 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 19 Nov 2018 14:44:08 +0000 (15:44 +0100)
PR tree-optimization/88071
* tree-vect-loop.c (vectorize_fold_left_reduction): Pass true instead
of false as last argument to gsi_remove.
* tree-vect-stmts.c (vect_finish_replace_stmt): Pass true instead of
false as last argument to gsi_replace.

* gcc.dg/pr88071.c: New test.

From-SVN: r266276

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

index dab887463498ced51c269b08b4f8350d30d5ea7d..d7db678d60d1ae023fd435fad2ee80be9c55056a 100644 (file)
@@ -1,5 +1,11 @@
 2018-11-19  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/88071
+       * tree-vect-loop.c (vectorize_fold_left_reduction): Pass true instead
+       of false as last argument to gsi_remove.
+       * tree-vect-stmts.c (vect_finish_replace_stmt): Pass true instead of
+       false as last argument to gsi_replace.
+
        PR debug/87039
        * omp-expand.c: Don't include debug.h.
        (adjust_context_and_scope): Add REGION argument.  Find DECL_CONTEXT
index 51196ba86259588b608eb99775bfd282e7306d7c..0c8672175617262861037c26bb670057f104cb0e 100644 (file)
@@ -1,5 +1,8 @@
 2018-11-19  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/88071
+       * gcc.dg/pr88071.c: New test.
+
        PR c++/60994
        * g++.dg/lookup/pr60994.C: New test.
 
diff --git a/gcc/testsuite/gcc.dg/pr88071.c b/gcc/testsuite/gcc.dg/pr88071.c
new file mode 100644 (file)
index 0000000..680bf8b
--- /dev/null
@@ -0,0 +1,5 @@
+/* PR tree-optimization/88071 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fexceptions -fnon-call-exceptions -fopenmp-simd -ftrapv -ftree-loop-vectorize" } */
+
+#include "gomp/openmp-simd-2.c"
index f2d9d8ac2bc44398f955650591eea20dc7fca8a5..81d8d466637ad9db24d80e034ca96327c370a65c 100644 (file)
@@ -5861,7 +5861,7 @@ vectorize_fold_left_reduction (stmt_vec_info stmt_info,
          /* Remove the statement, so that we can use the same code paths
             as for statements that we've just created.  */
          gimple_stmt_iterator tmp_gsi = gsi_for_stmt (new_stmt);
-         gsi_remove (&tmp_gsi, false);
+         gsi_remove (&tmp_gsi, true);
        }
 
       if (i == vec_num - 1)
index 764810b9bb692558e71ad08d7bbe5d3347682918..e41602dd11c3972c1aa2233357768276c9b63c29 100644 (file)
@@ -1720,7 +1720,7 @@ vect_finish_replace_stmt (stmt_vec_info stmt_info, gimple *vec_stmt)
   gcc_assert (gimple_get_lhs (stmt_info->stmt) == gimple_get_lhs (vec_stmt));
 
   gimple_stmt_iterator gsi = gsi_for_stmt (stmt_info->stmt);
-  gsi_replace (&gsi, vec_stmt, false);
+  gsi_replace (&gsi, vec_stmt, true);
 
   return vect_finish_stmt_generation_1 (stmt_info, vec_stmt);
 }