From patchwork Sat Sep 22 20:30:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix PR tree-optimization/54669 Date: Sat, 22 Sep 2012 10:30:40 -0000 From: Eric Botcazou X-Patchwork-Id: 186159 Message-Id: <2464442.KkiJcra08V@polaris> To: gcc-patches@gcc.gnu.org As demonstrated by the testcase, the new propagate_constants_for_unrolling can change the EH properties of a statement when it turns array accesses with variable index into array accesses with fixed index if -fnon-call-exception is enabled. The proposed fix is to call maybe_clean_or_replace_eh_stmt on the modified statement. There is already a call to cleanup_tree_cfg at the end so this should be sufficient. Tested on x86-64/Linux, OK for the mainline? 2012-09-22 Eric Botcazou PR tree-optimization/54669 * tree-ssa-loop-ivcanon.c (propagate_into_all_uses): Invoke maybe_clean_or_replace_eh_stmt on the modified use statements. 2012-09-22 Eric Botcazou * gcc.dg/pr54669.c: New test. Index: tree-ssa-loop-ivcanon.c =================================================================== --- tree-ssa-loop-ivcanon.c (revision 191387) +++ tree-ssa-loop-ivcanon.c (working copy) @@ -531,6 +531,7 @@ propagate_into_all_uses (tree ssa_name, fold_stmt_inplace (&use_stmt_gsi); update_stmt (use_stmt); + maybe_clean_or_replace_eh_stmt (use_stmt, use_stmt); } }