From: hubicka Date: Sun, 25 Feb 2007 18:11:20 +0000 (+0000) Subject: PR middle-end/30509 X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=fc128a8dad1a9328a7a8a26a98b934f06fb175d5 PR middle-end/30509 * tree-inline.c (copy_bb): Produce exact copy of EH info when copying for inlining. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122314 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6aa21b5c158..cc9e79e10de 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-02-24 Jan Hubicka + + PR middle-end/30509 + * tree-inline.c (copy_bb): Produce exact copy of EH info when copying for inlining. + 2007-02-24 Uros Bizjak Jan Hubicka diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 27d985ea139..349d109a7ca 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -873,7 +873,20 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale, int count_scal gcc_assert (lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt) != 0); - if (tree_could_throw_p (stmt)) + if (tree_could_throw_p (stmt) + /* When we are cloning for inlining, we are supposed to + construct a clone that calls precisely the same functions + as original. However IPA optimizers might've proved + earlier some function calls as non-trapping that might + render some basic blocks dead that might become + unreachable. + + We can't update SSA with unreachable blocks in CFG and thus + we prevent the scenario by preserving even the "dead" eh + edges until the point they are later removed by + fixup_cfg pass. */ + || (id->transform_call_graph_edges == CB_CGE_MOVE_CLONES + && lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt) > 0)) { int region = lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt); /* Add an entry for the copied tree in the EH hashtable.