fixed call generation
[libfirm] / ir / be / benode.c
index a60e01a..6302de3 100644 (file)
@@ -548,9 +548,15 @@ static int dump_node(ir_node *irn, FILE *f, dump_reason_t reason)
 
                        if(get_irn_be_opcode(irn) == beo_Spill) {
                                be_spill_attr_t *a = (be_spill_attr_t *) at;
-                               unsigned ofs = get_entity_offset_bytes(a->ent);
+
                                ir_fprintf(f, "spill context: %+F\n", a->spill_ctx);
-                               ir_fprintf(f, "spill entity: %+F offset %x (%d)\n", a->ent, ofs, ofs);
+                               if (a->ent) {
+                                       unsigned ofs = get_entity_offset_bytes(a->ent);
+                                       ir_fprintf(f, "spill entity: %+F offset %x (%d)\n", a->ent, ofs, ofs);
+                               }
+                               else {
+                                       ir_fprintf(f, "spill entity: n/a\n");
+                               }
                        }
                        break;
        }
@@ -577,7 +583,7 @@ static const ir_op_ops be_node_op_ops = {
 pset *nodes_live_at(const arch_env_t *arch_env, const arch_register_class_t *cls, const ir_node *pos, pset *live)
 {
        firm_dbg_module_t *dbg = firm_dbg_register("firm.be.node");
-       ir_node *bl            = get_nodes_block(pos);
+       const ir_node *bl      = is_Block(pos) ? pos : get_nodes_block(pos);
        ir_node *irn;
        irn_live_t *li;
 
@@ -613,7 +619,7 @@ pset *nodes_live_at(const arch_env_t *arch_env, const arch_register_class_t *cls
                }
        }
 
-       return NULL;
+       return live;
 }
 
 ir_node *insert_Perm_after(const arch_env_t *arch_env,
@@ -631,8 +637,7 @@ ir_node *insert_Perm_after(const arch_env_t *arch_env,
 
        DBG((dbg, LEVEL_1, "Insert Perm after: %+F\n", pos));
 
-       if(!nodes_live_at(arch_env, cls, pos, live))
-               assert(0 && "position not found");
+       if(!nodes_live_at(arch_env, cls, pos, live));
 
        n = pset_count(live);