re PR rtl-optimization/10692 ([m68k] miscompilation of perl with -O2 -fPIC)
authorRichard Henderson <rth@redhat.com>
Thu, 6 Jan 2005 04:09:11 +0000 (20:09 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 6 Jan 2005 04:09:11 +0000 (20:09 -0800)
        PR rtl-opt/10692
        * reload1.c (do_input_reload): Restrict the optimization deleteing
        a previous output reload to RELOAD_FOR_INPUT.

From-SVN: r92984

gcc/ChangeLog
gcc/reload1.c

index 281c9dbadf57ab232e7d55ed04c1c71d98e86eaa..078a19e702b664bb7080f5b14d95739064a97be5 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2005-01-05  Steven Bosscher  <stevenb@suse.de>
 
        * combine.c (expand_compound_operation)  <ZERO_EXTRACT>: Add
index 1fec0cdcc43b12a739947ff1bf6aa4e2fc4fbc76..df7580e20b738d710b3c2636852a29107252a925 100644 (file)
@@ -6822,6 +6822,10 @@ 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)