From 577232acabf6b92baa5ce14d400984cac80a5d84 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Sat, 29 Dec 2007 03:23:00 +0000 Subject: [PATCH] Fixed critical edges construction: Ignore real exception flow, handle regular flow. [r17085] --- ir/ir/irgopt.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ir/ir/irgopt.c b/ir/ir/irgopt.c index 9d52e9504..ac02ba8de 100644 --- a/ir/ir/irgopt.c +++ b/ir/ir/irgopt.c @@ -2218,7 +2218,8 @@ void place_code(ir_graph *irg) { } typedef struct cf_env { - char changed; /**< flag indicates that the cf graphs has changed. */ + char ignore_exc_edges; /**< set if exception edges should be ignored. */ + char changed; /**< flag indicates that the cf graphs has changed. */ } cf_env; /** @@ -2246,12 +2247,15 @@ static void walk_critical_cf_edges(ir_node *n, void *env) { const ir_op *cfop; pre = get_irn_n(n, i); - cfop = get_irn_op(skip_Proj(pre)); + /* don't count Bad's */ + if (is_Bad(pre)) + continue; + cfop = get_irn_op(skip_Proj(pre)); if (is_op_fragile(cfop)) { - if (cfop != op_Raise) - goto insert; - continue; + if (cenv->ignore_exc_edges && get_Proj_proj(pre) == pn_Generic_X_except) + continue; + goto insert; } /* we don't want place nodes in the start block, so handle it like forking */ if (is_op_forking(cfop) || cfop == op_Start) { @@ -2272,7 +2276,8 @@ insert: void remove_critical_cf_edges(ir_graph *irg) { cf_env env; - env.changed = 0; + env.ignore_exc_edges = 1; + env.changed = 0; irg_block_walk_graph(irg, NULL, walk_critical_cf_edges, &env); if (env.changed) { -- 2.20.1