- irg_block_walk(get_irg_end_block(irg), NULL, remove_dead_blocks, NULL);
+ irg_block_walk_graph(irg, NULL, remove_dead_block_cf, NULL);
+
+ /* fix the keep-alives */
+ for (i = 0, n = get_End_n_keepalives(end); i < n; ++i) {
+ ir_node *ka = get_End_keepalive(end, i);
+
+ if (is_Block(ka) && (get_Block_dom_depth(ka) == -1))
+ set_End_keepalive(end, i, new_Bad());
+ if (is_Phi(ka) && (get_Block_dom_depth(get_nodes_block(ka)) == -1))
+ set_End_keepalive(end, i, new_Bad());
+ }