From: Michael Beck Date: Thu, 10 Apr 2008 14:58:13 +0000 (+0000) Subject: - BugFix: Do not optimize dead blocks: They might even be immature when SSA construct... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=6b0ac7428c65605773adc075d22d2dcfb2d31b0e;p=libfirm - BugFix: Do not optimize dead blocks: They might even be immature when SSA construction was restartet ... [r19222] --- 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