From f6b4dc28f9743779b846ca04a4f97d293c8fd6fa Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 15 Sep 2015 12:37:19 +0000 Subject: [PATCH] re PR middle-end/67563 (verify_flow_info failed) 2015-09-15 Richard Biener PR middle-end/67563 * gimple-fold.c (gimplify_and_update_call_from_tree): Do not transfer EH info from old to new stmt. (replace_call_with_value): Likewise. (replace_call_with_call_and_fold): Likewise. (gimple_fold_builtin_memory_op): Likewise. (gimple_fold_builtin_memset): Likewise. (gimple_fold_builtin_stpcpy): Likewise. (gimple_fold_call): Likewise. * gcc.dg/pr67563.c: New testcase. From-SVN: r227788 --- gcc/ChangeLog | 12 ++++++++++++ gcc/gimple-fold.c | 22 +++++++++++----------- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr67563.c | 11 +++++++++++ 4 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr67563.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4db5afbbd9..ea2ebd0fa11 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2015-09-15 Richard Biener + + PR middle-end/67563 + * gimple-fold.c (gimplify_and_update_call_from_tree): Do not + transfer EH info from old to new stmt. + (replace_call_with_value): Likewise. + (replace_call_with_call_and_fold): Likewise. + (gimple_fold_builtin_memory_op): Likewise. + (gimple_fold_builtin_memset): Likewise. + (gimple_fold_builtin_stpcpy): Likewise. + (gimple_fold_call): Likewise. + 2015-09-15 Alan Lawrence * config/aarch64/aarch64.c (aarch64_simd_attr_length_rglist): Update diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index c79f9b3f436..ac9f46c860f 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -548,7 +548,7 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr) unlink_stmt_vdef (stmt); release_defs (stmt); } - gsi_replace (si_p, gimple_build_nop (), true); + gsi_replace (si_p, gimple_build_nop (), false); return; } } @@ -589,7 +589,7 @@ replace_call_with_value (gimple_stmt_iterator *gsi, tree val) unlink_stmt_vdef (stmt); release_ssa_name (vdef); } - gsi_replace (gsi, repl, true); + gsi_replace (gsi, repl, false); } /* Replace the call at *GSI with the new call REPL and fold that @@ -608,7 +608,7 @@ replace_call_with_call_and_fold (gimple_stmt_iterator *gsi, gimple repl) gimple_set_vuse (repl, gimple_vuse (stmt)); SSA_NAME_DEF_STMT (gimple_vdef (repl)) = repl; } - gsi_replace (gsi, repl, true); + gsi_replace (gsi, repl, false); fold_stmt (gsi); } @@ -655,7 +655,7 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi, unlink_stmt_vdef (stmt); release_ssa_name (vdef); } - gsi_replace (gsi, repl, true); + gsi_replace (gsi, repl, false); return true; } @@ -668,7 +668,7 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi, release_ssa_name (gimple_vdef (stmt)); if (!lhs) { - gsi_replace (gsi, gimple_build_nop (), true); + gsi_replace (gsi, gimple_build_nop (), false); return true; } goto done; @@ -750,7 +750,7 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi, SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt; if (!lhs) { - gsi_replace (gsi, new_stmt, true); + gsi_replace (gsi, new_stmt, false); return true; } gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT); @@ -1030,7 +1030,7 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi, SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt; if (!lhs) { - gsi_replace (gsi, new_stmt, true); + gsi_replace (gsi, new_stmt, false); return true; } gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT); @@ -1048,7 +1048,7 @@ done: dest = force_gimple_operand_gsi (gsi, dest, false, NULL_TREE, true, GSI_SAME_STMT); gimple repl = gimple_build_assign (lhs, dest); - gsi_replace (gsi, repl, true); + gsi_replace (gsi, repl, false); return true; } @@ -1130,7 +1130,7 @@ gimple_fold_builtin_memset (gimple_stmt_iterator *gsi, tree c, tree len) if (gimple_call_lhs (stmt)) { gimple asgn = gimple_build_assign (gimple_call_lhs (stmt), dest); - gsi_replace (gsi, asgn, true); + gsi_replace (gsi, asgn, false); } else { @@ -1980,7 +1980,7 @@ gimple_fold_builtin_stpcpy (gimple_stmt_iterator *gsi) gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT); gassign *ret = gimple_build_assign (gimple_call_lhs (stmt), POINTER_PLUS_EXPR, dest, tem); - gsi_replace (gsi, ret, true); + gsi_replace (gsi, ret, false); /* Finally fold the memcpy call. */ gimple_stmt_iterator gsi2 = *gsi; gsi_prev (&gsi2); @@ -3062,7 +3062,7 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace) && tree_int_cst_le (gimple_call_arg (stmt, 1), gimple_call_arg (stmt, 2)))) { - gsi_replace (gsi, gimple_build_nop (), true); + gsi_replace (gsi, gimple_build_nop (), false); unlink_stmt_vdef (stmt); release_defs (stmt); return true; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 69722d073be..23558560441 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-09-15 Richard Biener + + PR middle-end/67563 + * gcc.dg/pr67563.c: New testcase. + 2015-09-14 Manuel López-Ibáñez PR fortran/67460 diff --git a/gcc/testsuite/gcc.dg/pr67563.c b/gcc/testsuite/gcc.dg/pr67563.c new file mode 100644 index 00000000000..34a78a23a93 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr67563.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fexceptions" } */ + +static void +emit_package (int p1) +{ + int a; + int b[0]; + a = __fprintf_chk (0, 0, ""); +} +void emit_lua () { emit_package (0); } -- 2.30.2