- fix a conceptual bug in peephole, we need a callback before and after
[libfirm] / ir / be / benode.c
index f3bd545..70c5cae 100644 (file)
@@ -1073,16 +1073,15 @@ int be_get_IncSP_offset(const ir_node *irn)
        return a->offset;
 }
 
-ir_node *be_spill(const arch_env_t *arch_env, ir_node *irn)
+ir_node *be_spill(const arch_env_t *arch_env, ir_node *block, ir_node *irn)
 {
-       ir_node                     *bl        = get_nodes_block(irn);
-       ir_graph                    *irg       = get_irn_irg(bl);
+       ir_graph                    *irg       = get_irn_irg(block);
        ir_node                     *frame     = get_irg_frame(irg);
        const arch_register_class_t *cls       = arch_get_irn_reg_class(arch_env, irn, -1);
        const arch_register_class_t *cls_frame = arch_get_irn_reg_class(arch_env, frame, -1);
        ir_node                     *spill;
 
-       spill = be_new_Spill(cls, cls_frame, irg, bl, frame, irn);
+       spill = be_new_Spill(cls, cls_frame, irg, block, frame, irn);
        return spill;
 }
 
@@ -1250,7 +1249,7 @@ static int be_node_get_sp_bias(const void *self, const ir_node *irn)
        if(be_is_IncSP(irn))
                return be_get_IncSP_offset(irn);
        if(be_is_Call(irn))
-               return -be_Call_get_pop(irn);
+               return -(int)be_Call_get_pop(irn);
 
        return 0;
 }