Commit a203a221 by Jan Hubicka Committed by Jan Hubicka

tree-eh.c (make_eh_edges): Set probability 100% to first edge out of RESX.


	* tree-eh.c (make_eh_edges): Set probability 100% to first edge out of RESX.
	(tree_remove_unreachable_handlers): Cleanup EH predecestor detection and label
	handling.

From-SVN: r145322
parent 7db6438d
2009-03-30 Jan Hubicka <jh@suse.cz>
* tree-eh.c (make_eh_edges): Set probability 100% to first edge out of RESX.
(tree_remove_unreachable_handlers): Cleanup EH predecestor detection and label
handling.
2009-03-30 Vladimir Makarov <vmakarov@redhat.com> 2009-03-30 Vladimir Makarov <vmakarov@redhat.com>
* ira-int.h (ira_allocno): Rename left_conflicts_num to * ira-int.h (ira_allocno): Rename left_conflicts_num to
......
...@@ -1974,6 +1974,7 @@ make_eh_edges (gimple stmt) ...@@ -1974,6 +1974,7 @@ make_eh_edges (gimple stmt)
int region_nr; int region_nr;
bool is_resx; bool is_resx;
bool inlinable = false; bool inlinable = false;
basic_block bb;
if (gimple_code (stmt) == GIMPLE_RESX) if (gimple_code (stmt) == GIMPLE_RESX)
{ {
...@@ -1990,6 +1991,13 @@ make_eh_edges (gimple stmt) ...@@ -1990,6 +1991,13 @@ make_eh_edges (gimple stmt)
} }
foreach_reachable_handler (region_nr, is_resx, inlinable, make_eh_edge, stmt); foreach_reachable_handler (region_nr, is_resx, inlinable, make_eh_edge, stmt);
/* Make CFG profile more consistent assuming that exception will resume to first
available EH handler. In practice this makes little difference, but we get
fewer consistency errors in the dumps. */
bb = gimple_bb (stmt);
if (is_resx && EDGE_COUNT (bb->succs))
EDGE_SUCC (bb, 0)->probability = REG_BR_PROB_BASE;
} }
static bool mark_eh_edge_found_error; static bool mark_eh_edge_found_error;
...@@ -2659,12 +2667,7 @@ tree_remove_unreachable_handlers (void) ...@@ -2659,12 +2667,7 @@ tree_remove_unreachable_handlers (void)
{ {
gimple_stmt_iterator gsi; gimple_stmt_iterator gsi;
int region; int region;
bool has_eh_preds = false; bool has_eh_preds = bb_has_eh_pred (bb);
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, bb->preds) if (e->flags & EDGE_EH)
has_eh_preds = true;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{ {
...@@ -2673,11 +2676,8 @@ tree_remove_unreachable_handlers (void) ...@@ -2673,11 +2676,8 @@ tree_remove_unreachable_handlers (void)
if (gimple_code (stmt) == GIMPLE_LABEL && has_eh_preds) if (gimple_code (stmt) == GIMPLE_LABEL && has_eh_preds)
{ {
int uid = LABEL_DECL_UID (gimple_label_label (stmt)); int uid = LABEL_DECL_UID (gimple_label_label (stmt));
if (uid <= cfun->cfg->last_label_uid) int region = VEC_index (int, label_to_region, uid);
{ SET_BIT (reachable, region);
int region = VEC_index (int, label_to_region, uid);
SET_BIT (reachable, region);
}
} }
if (gimple_code (stmt) == RESX) if (gimple_code (stmt) == RESX)
SET_BIT (reachable, gimple_resx_region (stmt)); SET_BIT (reachable, gimple_resx_region (stmt));
...@@ -2824,14 +2824,15 @@ cleanup_empty_eh (basic_block bb) ...@@ -2824,14 +2824,15 @@ cleanup_empty_eh (basic_block bb)
if (!stmt_can_throw_internal (last_stmt (src))) if (!stmt_can_throw_internal (last_stmt (src)))
continue; continue;
make_eh_edges (last_stmt (src)); make_eh_edges (last_stmt (src));
FOR_EACH_EDGE (e, ei, src->succs) if (e->flags & EDGE_EH) FOR_EACH_EDGE (e, ei, src->succs)
{ if (e->flags & EDGE_EH)
dominance_info_invalidated = true; {
for (si = gsi_start_phis (e->dest); !gsi_end_p (si); dominance_info_invalidated = true;
gsi_next (&si)) for (si = gsi_start_phis (e->dest); !gsi_end_p (si);
mark_sym_for_renaming (SSA_NAME_VAR gsi_next (&si))
(PHI_RESULT (gsi_stmt (si)))); mark_sym_for_renaming (SSA_NAME_VAR
} (PHI_RESULT (gsi_stmt (si))));
}
} }
if (dump_file) if (dump_file)
fprintf (dump_file, "Empty EH handler %i removed\n", region); fprintf (dump_file, "Empty EH handler %i removed\n", region);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment