From c01350c31be83267bb98f8c726b023892d647c87 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 23 May 2007 13:56:17 +0000 Subject: [PATCH] add_irn_keepalive() - only Phi, Block and Keep nodes can be kept alive! Workaround for beabi: - beabi needs to keep a Proj(M) :-( [r14005] --- ir/ir/irnode.c | 1 + ir/ir/iropt.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index 72e2c6806..4d5a0de06 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -861,6 +861,7 @@ get_End_keepalive(ir_node *end, int pos) { void add_End_keepalive (ir_node *end, ir_node *ka) { assert(end->op == op_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!"); add_irn_n(end, ka); } diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 38e5f087b..03a880cd0 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -3183,9 +3183,12 @@ static ir_node *transform_node_End(ir_node *n) { if (! is_Block_dead(ka)) { in[j++] = ka; } + continue; } else if (is_irn_pinned_in_irg(ka) && is_Block_dead(get_nodes_block(ka))) { continue; - } if (is_Phi(ka) || is_irn_keep(ka)) + } + /* FIXME: beabi need to keep a Proj(M) */ + if (is_Phi(ka) || is_irn_keep(ka) || is_Proj(ka)) in[j++] = ka; } if (j != n_keepalives) -- 2.20.1