From: Matthias Braun Date: Mon, 3 May 2010 09:10:44 +0000 (+0000) Subject: use barriers instead of be_Keep to keep unused nodes since we can't guarantee the... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=4ebf91ab4349975628962fcae404cdf0c340f49e;p=libfirm use barriers instead of be_Keep to keep unused nodes since we can't guarantee the rule that a keep is always right behind the definition of a value [r27462] --- diff --git a/ir/be/bepeephole.c b/ir/be/bepeephole.c index c14faf82a..5d3065b0f 100644 --- a/ir/be/bepeephole.c +++ b/ir/be/bepeephole.c @@ -307,7 +307,8 @@ static void skip_barrier(ir_node *block, ir_graph *irg) assert(n < n_in); in[n++] = get_irn_n(irn, i); } - keep = be_new_Keep(get_nodes_block(irn), n_in, in); + keep = be_new_Barrier(get_nodes_block(irn), n_in, in); + keep_alive(keep); sched_add_before(irn, keep); } @@ -322,7 +323,7 @@ static void skip_barrier(ir_node *block, ir_graph *irg) static void kill_barriers(ir_graph *irg) { ir_node *end_blk = get_irg_end_block(irg); - ir_node *start_blk; + ir_node *start_blk = get_irg_start_block(irg); int i; /* skip the barrier on all return blocks */ @@ -330,6 +331,9 @@ static void kill_barriers(ir_graph *irg) ir_node *be_ret = get_Block_cfgpred(end_blk, i); ir_node *ret_blk = get_nodes_block(be_ret); + if (ret_blk == start_blk) + continue; + skip_barrier(ret_blk, irg); }