From: Michael Beck Date: Tue, 24 Jul 2007 16:54:10 +0000 (+0000) Subject: mark labelled blocks as non-empty, preventing them to be removed X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=219a43ae7de85cb52c63c6cf195fe97f66e36c64;p=libfirm mark labelled blocks as non-empty, preventing them to be removed [r15324] --- diff --git a/ir/opt/cfopt.c b/ir/opt/cfopt.c index 6fa73c7bf..e5380d9d4 100644 --- a/ir/opt/cfopt.c +++ b/ir/opt/cfopt.c @@ -62,6 +62,8 @@ /* is empty if it contains only a Jmp node. */ /* Blocks can only be removed if they are not needed for the */ /* semantics of Phi nodes. */ +/* Further, we NEVER remove labeled blocks (even if we could move */ +/* the label. */ /*------------------------------------------------------------------*/ /** @@ -226,7 +228,11 @@ static void collect_nodes(ir_node *n, void *ctx) { ir_op *op = get_irn_op(n); merge_env *env = ctx; - if (op != op_Block) { + if (op == op_Block) { + /* mark the block as non-empty if it is labelled */ + if (has_Block_label(n)) + mark_Block_block_visited(n); + } else { ir_node *b = get_nodes_block(n); if (op == op_Phi) {