From 4cb3570c8c453a830589b717d8519daa31ec7468 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 19 Nov 2018 15:44:08 +0100 Subject: [PATCH] re PR tree-optimization/88071 (ICE: verify_gimple failed (error: dead STMT in EH table)) 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 | 6 ++++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.dg/pr88071.c | 5 +++++ gcc/tree-vect-loop.c | 2 +- gcc/tree-vect-stmts.c | 2 +- 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr88071.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dab88746349..d7db678d60d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2018-11-19 Jakub Jelinek + 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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 51196ba8625..0c867217561 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-11-19 Jakub Jelinek + 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 index 00000000000..680bf8b74f2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr88071.c @@ -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" diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index f2d9d8ac2bc..81d8d466637 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -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) diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 764810b9bb6..e41602dd11c 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -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); } -- 2.30.2