X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeabi.c;h=ef81cd98665c0943a04b47cfdee0357c7c090d14;hb=4ed245f5007168dab7850942a7ee6b6b29a19817;hp=d326f64a7f616e0009aff6333d02db815e0ca931;hpb=d6b7e949a935d6f5a41494982360017651d691cc;p=libfirm diff --git a/ir/be/beabi.c b/ir/be/beabi.c index d326f64a7..ef81cd986 100644 --- a/ir/be/beabi.c +++ b/ir/be/beabi.c @@ -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 (is_Block(irn)) + return; + + mode = get_irn_mode(irn); - if(arch_irn_is(info->aenv, irn, modify_sp)) + if (arch_irn_is(info->aenv, irn, modify_sp) && mode != mode_T && mode != mode_M) pset_insert_ptr(info->nodes, irn); } @@ -1992,7 +2002,7 @@ static entity *abi_get_frame_entity(const void *_self, const ir_node *irn) return NULL; } -static void abi_set_frame_entity(const void *_self, const ir_node *irn, entity *ent) +static void abi_set_frame_entity(const void *_self, ir_node *irn, entity *ent) { }