From b597c7fd473086ca6374b2abbdf129f595c156d0 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 10 Sep 2008 14:06:24 +0000 Subject: [PATCH] - Changed keep logic: all nodes can be keeped yet, thi is necessary to fix fehler152 [r21820] --- ir/ir/irnode.c | 6 +++++- ir/ir/iropt.c | 4 +--- ir/opt/cfopt.c | 6 +----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index 235e847e6..b0d062fc5 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -902,8 +902,12 @@ ir_node *get_End_keepalive(const ir_node *end, int pos) { } void add_End_keepalive(ir_node *end, ir_node *ka) { + ir_graph *irg = get_irn_irg(end); assert(is_End(end)); - assert((is_Phi(ka) || is_Proj(ka) || is_Block(ka) || is_irn_keep(ka)) && "Only Phi, Block or Keep nodes can be kept alive!"); + + if (get_irg_phase_state(irg) == phase_building) { + assert((is_Phi(ka) || is_Block(ka) || is_irn_keep(ka)) && "Only Phi, Block or Keep nodes can be kept alive!"); + } add_irn_n(end, ka); } diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 2f3346c85..219c7d72a 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -5316,9 +5316,7 @@ static ir_node *transform_node_End(ir_node *n) { } else if (is_irn_pinned_in_irg(ka) && is_Block_dead(get_nodes_block(ka))) { continue; } - /* FIXME: beabi need to keep a Proj(M) */ - if (is_Phi(ka) || is_irn_keep(ka) || is_Proj(ka)) - in[j++] = ka; + in[j++] = ka; } if (j != n_keepalives) set_End_keepalives(n, j, in); diff --git a/ir/opt/cfopt.c b/ir/opt/cfopt.c index a71204065..e3a14b48d 100644 --- a/ir/opt/cfopt.c +++ b/ir/opt/cfopt.c @@ -798,15 +798,11 @@ restart: irg_block_walk(ka, optimize_blocks, remove_simple_blocks, &env.changed); mark_irn_visited(ka); in[j++] = ka; - } else if (op == op_Phi) { + } else { mark_irn_visited(ka); /* don't keep alive dead blocks */ if (! is_Block_dead(get_nodes_block(ka))) in[j++] = ka; - } else if (is_op_keep(op)) { - mark_irn_visited(ka); - if (! is_Block_dead(get_nodes_block(ka))) - in[j++] = ka; } } } -- 2.20.1