add_irn_keepalive()
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 23 May 2007 13:56:17 +0000 (13:56 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 23 May 2007 13:56:17 +0000 (13:56 +0000)
- 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
ir/ir/iropt.c

index 72e2c68..4d5a0de 100644 (file)
@@ -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);
 }
 
index 38e5f08..03a880c 100644 (file)
@@ -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)