X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fcombo.c;h=66e77693ebece4bacb3720a853b00c0a46ff3ff5;hb=762b472fc81c73cf7a1b0041b8cd286b7206d79d;hp=d234258fe0ef55af27d31116887d740056bf12cf;hpb=ae9fd2c229cc7f4c724ce9ccc9263c16d77670fe;p=libfirm diff --git a/ir/opt/combo.c b/ir/opt/combo.c index d234258fe..66e77693e 100644 --- a/ir/opt/combo.c +++ b/ir/opt/combo.c @@ -2975,6 +2975,11 @@ static int can_exchange(ir_node *pred, ir_node *block) return 0; else if (is_Jmp(pred)) return 1; + else if (is_Raise(pred)) { + /* Raise is a tuple and usually has only one reachable ProjX, + * but it must not be eliminated like a Jmp */ + return 0; + } else if (get_irn_mode(pred) == mode_T) { /* if the predecessor block has more than one reachable outputs we cannot remove the block */ @@ -3024,16 +3029,9 @@ static void apply_cf(ir_node *block, void *ctx) } } - /* the EndBlock is always reachable even if the analysis - finds out the opposite :-) */ - if (block != get_irg_end_block(current_ir_graph)) { - /* mark dead blocks */ - //set_Block_dead(block); - //ir_graph *irg = get_irn_irg(block); - //exchange(block, get_irg_bad(irg)); - DB((dbg, LEVEL_1, "Removing dead %+F\n", block)); - } else { - /* the endblock is unreachable */ + if (block == get_irg_end_block(current_ir_graph)) { + /* Analysis found out that the end block is unreachable, + * hence we remove all its control flow predecessors. */ set_irn_in(block, 0, NULL); } return; @@ -3597,7 +3595,6 @@ void combo(ir_graph *irg) /* control flow might changed */ set_irg_extblk_inconsistent(irg); set_irg_doms_inconsistent(irg); - set_irg_loopinfo_inconsistent(irg); set_irg_entity_usage_state(irg, ir_entity_usage_not_computed); }