X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeabi.c;h=ef81cd98665c0943a04b47cfdee0357c7c090d14;hb=4ed245f5007168dab7850942a7ee6b6b29a19817;hp=fcb5ad9f86581484e2cce45cee644d557ac329c3;hpb=9f14198f2683636d7ee1aa6547ebcf3f373688af;p=libfirm diff --git a/ir/be/beabi.c b/ir/be/beabi.c index fcb5ad9f8..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(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 = {