From 6b0ac7428c65605773adc075d22d2dcfb2d31b0e Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 10 Apr 2008 14:58:13 +0000 Subject: [PATCH] - BugFix: Do not optimize dead blocks: They might even be immature when SSA construction was restartet ... [r19222] --- ir/ir/iropt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index ac9fe39cf..ee92310ff 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -722,10 +722,16 @@ static ir_op_ops *firm_set_default_computed_value(ir_opcode code, ir_op_ops *ops static ir_node *equivalent_node_Block(ir_node *n) { ir_node *oldn = n; - int n_preds = get_Block_n_cfgpreds(n); + int n_preds; - /* The Block constructor does not call optimize, but mature_immBlock - calls the optimization. */ + /* don't optimize dead blocks */ + if (is_Block_dead(n)) + return n; + + n_preds = get_Block_n_cfgpreds(n); + + /* The Block constructor does not call optimize, but mature_immBlock() + calls the optimization. */ assert(get_Block_matured(n)); /* Straightening: a single entry Block following a single exit Block -- 2.20.1