re PR rtl-optimization/10692 ([m68k] miscompilation of perl with -O2 -fPIC)
authorBernd Schmidt <bernd.schmidt@analog.com>
Tue, 17 Apr 2007 15:29:34 +0000 (15:29 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Tue, 17 Apr 2007 15:29:34 +0000 (15:29 +0000)
* reload1.c (delete_output_reload): Don't count output in n_inherited.

Revert
2005-01-05  Richard Henderson  <rth@redhat.com>
PR rtl-opt/10692
* reload1.c (do_input_reload): Restrict the optimization deleteing
a previous output reload to RELOAD_FOR_INPUT.

From-SVN: r123913

gcc/ChangeLog
gcc/reload1.c

index d065322a2b71ece891a5510a12d1a0254ec74c84..a315b6f4eb498060c082753f3b3ddf2a59fa7d27 100644 (file)
@@ -1,3 +1,13 @@
+2007-04-17  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+       * reload1.c (delete_output_reload): Don't count output in n_inherited.
+
+       Revert
+       2005-01-05  Richard Henderson  <rth@redhat.com>
+       PR rtl-opt/10692
+       * reload1.c (do_input_reload): Restrict the optimization deleteing
+       a previous output reload to RELOAD_FOR_INPUT.
+
 2007-04-17  Dorit Nuzman  <dorit@il.ibm.com>
 
        * tree-vectorizer.h (stmt_vec_info_type): Add enum value
index 9a56fc40bd0894b8b7e927b0f12b07c28fbea8ba..8c698ef3399c3ed46112f967aa1556399df4f15e 100644 (file)
@@ -7156,10 +7156,6 @@ do_input_reload (struct insn_chain *chain, struct reload *rl, int j)
      actually no need to store the old value in it.  */
 
   if (optimize
-      /* Only attempt this for input reloads; for RELOAD_OTHER we miss
-        that there may be multiple uses of the previous output reload.
-        Restricting to RELOAD_FOR_INPUT is mostly paranoia.  */
-      && rl->when_needed == RELOAD_FOR_INPUT
       && (reload_inherited[j] || reload_override_in[j])
       && rl->reg_rtx
       && REG_P (rl->reg_rtx)
@@ -8010,16 +8006,7 @@ delete_output_reload (rtx insn, int j, int last_reload_reg)
       if (rtx_equal_p (reg2, reg))
        {
          if (reload_inherited[k] || reload_override_in[k] || k == j)
-           {
-             n_inherited++;
-             reg2 = rld[k].out_reg;
-             if (! reg2)
-               continue;
-             while (GET_CODE (reg2) == SUBREG)
-               reg2 = XEXP (reg2, 0);
-             if (rtx_equal_p (reg2, reg))
-               n_inherited++;
-           }
+           n_inherited++;
          else
            return;
        }