This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[mainline/4.0] Fix duplicate_bb wrt EH handling
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Mon, 25 Apr 2005 09:42:25 +0200
- Subject: [mainline/4.0] Fix duplicate_bb wrt EH handling
Hi,
tree_duplicate_bb forgets to copy EH region that looks like pretty serious bug.
Bootstrapped/regtested i686-pc-gnu-linux. I don't have testcase but it happens
on 2 of testcases in g++ testsuite and is turned to ICE by followup patch adding
EH verifier.
Honza
2005-04-25 Jan Hubicka <jh@suse.cz>
* tree-cfg.c (tree_duplicate_bb): Duplicate EH region too.
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.179
diff -c -3 -p -r2.179 tree-cfg.c
*** tree-cfg.c 23 Apr 2005 21:27:56 -0000 2.179
--- tree-cfg.c 24 Apr 2005 15:12:29 -0000
*************** tree_duplicate_bb (basic_block bb)
*** 4729,4734 ****
--- 4731,4737 ----
def_operand_p def_p;
ssa_op_iter op_iter;
tree stmt, copy;
+ int region;
stmt = bsi_stmt (bsi);
if (TREE_CODE (stmt) == LABEL_EXPR)
*************** tree_duplicate_bb (basic_block bb)
*** 4739,4744 ****
--- 4742,4750 ----
copy = unshare_expr (stmt);
bsi_insert_after (&bsi_tgt, copy, BSI_NEW_STMT);
copy_virtual_operands (copy, stmt);
+ region = lookup_stmt_eh_region (stmt);
+ if (region >= 0)
+ add_stmt_to_eh_region (copy, region);
/* Create new names for all the definitions created by COPY and
add replacement mappings for each new name. */