From: Christian Würdig Date: Mon, 9 Oct 2006 09:07:46 +0000 (+0000) Subject: fixed gen_Load (add Proj for unused volatile Loads before renumbering) X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=e8bdf4f64c01a81ce6eac6f7c1dd3bf732a8fb76;p=libfirm fixed gen_Load (add Proj for unused volatile Loads before renumbering) --- diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index 972b0c326..76a96d1e2 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -1427,6 +1427,16 @@ static ir_node *gen_Load(ia32_transform_env_t *env) { ia32_collect_Projs(env->irn, projs, pn_Load_max); + /* + check for special case: the loaded value might not be used (optimized, volatile, ...) + we add a Proj + Keep for volatile loads and ignore all other cases + */ + if (! get_proj_for_pn(node, pn_Load_res) && get_Load_volatility(node) == volatility_is_volatile) { + /* add a result proj and a Keep to produce a pseudo use */ + ir_node *proj = new_r_Proj(env->irg, env->block, new_op, mode, pn_ia32_Load_res); + be_new_Keep(arch_get_irn_reg_class(env->cg->arch_env, proj, -1), env->irg, env->block, 1, &proj); + } + /* address might be a constant (symconst or absolute address) */ if (is_ia32_Const(ptr)) { lptr = noreg; @@ -1469,16 +1479,6 @@ static ir_node *gen_Load(ia32_transform_env_t *env) { set_ia32_am_flavour(new_op, am_flav); set_ia32_ls_mode(new_op, mode); - /* - check for special case: the loaded value might not be used (optimized, volatile, ...) - we add a Proj + Keep for volatile loads and ignore all other cases - */ - if (! get_proj_for_pn(node, pn_Load_res) && get_Load_volatility(node) == volatility_is_volatile) { - /* add a result proj and a Keep to produce a pseudo use */ - ir_node *proj = new_r_Proj(env->irg, env->block, new_op, mode, pn_ia32_Load_res); - be_new_Keep(arch_get_irn_reg_class(env->cg->arch_env, proj, -1), env->irg, env->block, 1, &proj); - } - SET_IA32_ORIG_NODE(new_op, ia32_get_old_node_name(env->cg, env->irn)); return new_op;