fixed debug output of unary x87 nodes
[libfirm] / ir / be / beabi.c
index fcb5ad9..ef81cd9 100644 (file)
@@ -1718,14 +1718,18 @@ be_abi_irg_t *be_abi_introduce(be_irg_t *birg)
        restore_optimization_state(&state);
        FIRM_DBG_REGISTER(env->dbg, "firm.be.abi");
 
-       env->cb = env->call->cb->init(env->call, birg->main_env->arch_env, irg);
-
        memcpy(&env->irn_handler, &abi_irn_handler, sizeof(abi_irn_handler));
        env->irn_ops.impl = &abi_irn_ops;
 
        /* Lower all call nodes in the IRG. */
        process_calls(env);
 
+       /*
+               Beware: init backend abi call object after processing calls,
+               otherwise some information might be not yet available.
+       */
+       env->cb = env->call->cb->init(env->call, birg->main_env->arch_env, irg);
+
        /* Process the IRG */
        modify_irg(env);
 
@@ -1789,8 +1793,14 @@ struct fix_stack_walker_info {
 static void collect_stack_nodes_walker(ir_node *irn, void *data)
 {
        struct fix_stack_walker_info *info = data;
+       ir_mode *mode;
 
-       if(arch_irn_is(info->aenv, irn, modify_sp))
+       if (is_Block(irn))
+               return;
+
+       mode = get_irn_mode(irn);
+
+       if (arch_irn_is(info->aenv, irn, modify_sp) && mode != mode_T && mode != mode_M)
                pset_insert_ptr(info->nodes, irn);
 }
 
@@ -1992,6 +2002,10 @@ static entity *abi_get_frame_entity(const void *_self, const ir_node *irn)
        return NULL;
 }
 
+static void abi_set_frame_entity(const void *_self, ir_node *irn, entity *ent)
+{
+}
+
 static void abi_set_stack_bias(const void *_self, ir_node *irn, int bias)
 {
 }
@@ -2003,7 +2017,12 @@ static const arch_irn_ops_if_t abi_irn_ops = {
        abi_classify,
        abi_get_flags,
        abi_get_frame_entity,
-       abi_set_stack_bias
+       abi_set_frame_entity,
+       abi_set_stack_bias,
+       NULL,    /* get_inverse             */
+       NULL,    /* get_op_estimated_cost   */
+       NULL,    /* possible_memory_operand */
+       NULL,    /* perform_memory_operand  */
 };
 
 static const arch_irn_handler_t abi_irn_handler = {