From 4d7d203e2f137e9a25aefb64ff4406886aab7839 Mon Sep 17 00:00:00 2001 From: Sebastian Hack Date: Thu, 9 Mar 2006 17:48:32 +0000 Subject: [PATCH] Fixed a bug --- ir/be/beabi.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/ir/be/beabi.c b/ir/be/beabi.c index d9f014111..ec8b33285 100644 --- a/ir/be/beabi.c +++ b/ir/be/beabi.c @@ -1124,8 +1124,7 @@ be_abi_irg_t *be_abi_introduce(be_irg_t *birg) { be_abi_irg_t *env = malloc(sizeof(env[0])); - int i; - ir_node **nodes; + ir_node *dummy; pmap_entry *ent; env->isa = birg->main_env->arch_env->isa; @@ -1137,7 +1136,7 @@ be_abi_irg_t *be_abi_introduce(be_irg_t *birg) env->birg = birg; env->dbg = firm_dbg_register("firm.be.abi"); env->stack_phis = pset_new_ptr(16); - env->init_sp = new_r_Unknown(birg->irg, env->isa->sp->reg_class->mode); + env->init_sp = dummy = new_r_Unknown(birg->irg, env->isa->sp->reg_class->mode); obstack_init(&env->obst); @@ -1147,30 +1146,17 @@ be_abi_irg_t *be_abi_introduce(be_irg_t *birg) /* Lower all call nodes in the IRG. */ process_calls(env); -#if 0 - /* search for stack allocation nodes and record them */ - irg_walk_graph(env->birg->irg, collect_alloca_walker, NULL, env); - obstack_ptr_grow(&env->obst, NULL); - nodes = obstack_finish(&env->obst); - - /* If there are stack allocations in the irg, we need a frame pointer */ - if(nodes[0] != NULL) - env->call->flags.bits.try_omit_fp = 0; -#endif - + /* Process the IRG */ modify_irg(env); + /* reroute the stack origin of the calls to the true stack origin. */ + exchange(dummy, env->init_sp); + /* Make some important node pointers survive the dead node elimination. */ survive_dce_register_irn(env->dce_survivor, &env->init_sp); for(ent = pmap_first(env->regs); ent; ent = pmap_next(env->regs)) survive_dce_register_irn(env->dce_survivor, (ir_node **) &ent->value); - /* Fix the alloca-style allocations */ -#if 0 - for(i = 0; nodes[i] != NULL; ++i) - implement_stack_alloc(env, nodes[i]); -#endif - arch_env_push_irn_handler(env->birg->main_env->arch_env, &env->irn_handler); return env; -- 2.20.1