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

From-SVN: r92986

gcc/ChangeLog
gcc/reload1.c

index 2655868df895e2a00b2f7024343710b3ec2d5464..ce5c3fcad69484f589d5b492ba743c3b3630ffd6 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-06  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline:
index 1c8d66078293e40b60df6a52e7ba23bb382d770a..bd2bb706a1f8c759f35714cb20d7465e50f941b5 100644 (file)
@@ -1,6 +1,6 @@
 /* Reload pseudo regs into hard regs for insns that require hard regs.
    Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -6825,6 +6825,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
       && GET_CODE (rl->reg_rtx) == REG