From: Christian Würdig Date: Mon, 21 Aug 2006 13:02:55 +0000 (+0000) Subject: moved backend init call after processing calls X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=8cd302cbb375af6b8c646179b9ee1abaf629ffee;p=libfirm moved backend init call after processing calls --- diff --git a/ir/be/beabi.c b/ir/be/beabi.c index 44df17f5f..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);