re PR middle-end/30509 (ice for legal code with -O3)

PR middle-end/30509
	* tree-inline.c (copy_bb): Produce exact copy of EH info when copying for inlining.

From-SVN: r122314
This commit is contained in:
Jan Hubicka 2007-02-25 19:11:20 +01:00 committed by Jan Hubicka
parent bd8d4d1917
commit 2a025b54f6
2 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2007-02-24 Jan Hubicka <jh@suse.cz>
PR middle-end/30509
* tree-inline.c (copy_bb): Produce exact copy of EH info when copying for inlining.
2007-02-24 Uros Bizjak <ubizjak@gmail.com> 2007-02-24 Uros Bizjak <ubizjak@gmail.com>
Jan Hubicka <jh@suse.cz> Jan Hubicka <jh@suse.cz>

View File

@ -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) gcc_assert (lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt)
!= 0); != 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); int region = lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt);
/* Add an entry for the copied tree in the EH hashtable. /* Add an entry for the copied tree in the EH hashtable.