X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fcfopt.c;h=ee492eb6bceff70a9a4aff92339b9a6d3aafc873;hb=0910ef4a7bad0429f8f0f29ecc1291c5aa8f3059;hp=33afb24696999c5b3da8aeeba46a929d2577fc1d;hpb=fe6c9130a81330693ec34a0e2a261ccf47b48599;p=libfirm diff --git a/ir/opt/cfopt.c b/ir/opt/cfopt.c index 33afb2469..ee492eb6b 100644 --- a/ir/opt/cfopt.c +++ b/ir/opt/cfopt.c @@ -675,7 +675,7 @@ static void compute_block_info(ir_node *n, void *x) } else if (is_Phi(n)) { ir_node *block = get_nodes_block(n); set_has_phis(block_info, block); - } else if (is_Jmp(n) || is_Cond(n) || is_Cmp(n) || is_Proj(n)) { + } else if (is_Jmp(n) || is_Cond(n) || is_Proj(n)) { /* ignore */ } else { ir_node *block = get_nodes_block(n); @@ -742,6 +742,19 @@ static void remove_empty_blocks(ir_node *block, void *x) continue; /* this block contains operations and cannot be skipped */ if (has_phis(env->phase,jmp_block)) continue; /* this block contains Phis and is not skipped */ + if (Block_block_visited(jmp_block)) { + continue; + /* otherwise we could break the walker, + * if block was reached via KeepAlive edge -> jmp_block -> A ---> block, + * because the walker cannot handle Id nodes. + * + * A B + * \ / + * jmp_block + * / \ + * block End + */ + } /* jmp_block is an empty block and can be optimized! */