------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-16 00:44 ------- This patch works for me on this testcase, I have not done a full bootstrap/test yet: Index: tree-ssa-propagate.c =============================================================== ==== RCS file: /cvs/gcc/gcc/gcc/tree-ssa-propagate.c,v retrieving revision 2.19 diff -u -p -r2.19 tree-ssa-propagate.c --- tree-ssa-propagate.c 11 May 2005 08:14:24 -0000 2.19 +++ tree-ssa-propagate.c 16 May 2005 00:43:18 -0000 @@ -558,7 +558,7 @@ get_rhs (tree stmt) bool set_rhs (tree *stmt_p, tree expr) { - tree stmt = *stmt_p, op; + tree stmt = *stmt_p, op, new_stmt; enum tree_code code = TREE_CODE (expr); stmt_ann_t ann; tree var; @@ -621,7 +621,17 @@ set_rhs (tree *stmt_p, tree expr) /* Replace the whole statement with EXPR. If EXPR has no side effects, then replace *STMT_P with an empty statement. */ ann = stmt_ann (stmt); - *stmt_p = TREE_SIDE_EFFECTS (expr) ? expr : build_empty_stmt (); + new_stmt = TREE_SIDE_EFFECTS (expr) ? expr : build_empty_stmt (); + { + /* Update the eh region for the new statement. */ + int old_eh_region = lookup_stmt_eh_region (stmt); + if (old_eh_region >= 0) + { + remove_stmt_from_eh_region (stmt); + add_stmt_to_eh_region (new_stmt, old_eh_region); + } + } + *stmt_p = new_stmt; (*stmt_p)->common.ann = (tree_ann_t) ann; if (TREE_SIDE_EFFECTS (expr))
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21399