fixed gen_Load (add Proj for unused volatile Loads before renumbering)
authorChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Mon, 9 Oct 2006 09:07:46 +0000 (09:07 +0000)
committerChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Mon, 9 Oct 2006 09:07:46 +0000 (09:07 +0000)
ir/be/ia32/ia32_transform.c

index 972b0c3..76a96d1 100644 (file)
@@ -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;