]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
reload1.c (emit_reload_insns): Pass the reload register for a non-spill output reload...
authorRichard Sandiford <richard@codesourcery.com>
Wed, 24 Jan 2007 08:16:14 +0000 (08:16 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 24 Jan 2007 08:16:14 +0000 (08:16 +0000)
gcc/
* reload1.c (emit_reload_insns): Pass the reload register
for a non-spill output reload through forget_old_reloads_1.

From-SVN: r121105

gcc/ChangeLog
gcc/reload1.c

index abd821fa2aea7a168dcf02430c45ec5098e64aff..b1946e83e7e04c9d5a17636836309e83e964c655 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-24  Richard Sandiford  <richard@codesourcery.com>
+
+       * reload1.c (emit_reload_insns): Pass the reload register
+       for a non-spill output reload through forget_old_reloads_1.
+
 2007-01-23  Joseph Myers  <joseph@codesourcery.com>
 
        * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define
index efa1a397212f45ea3a13b6c39b316f0820a01979..8f7c703c41519038559c5a487c5be592d058982d 100644 (file)
@@ -7561,6 +7561,23 @@ emit_reload_insns (struct insn_chain *chain)
          rtx out = ((rld[r].out && REG_P (rld[r].out))
                     ? rld[r].out : rld[r].out_reg);
          int nregno = REGNO (out);
+
+         /* REG_RTX is now set or clobbered by the main instruction.
+            As the comment above explains, forget_old_reloads_1 only
+            sees the original instruction, and there is no guarantee
+            that the original instruction also clobbered REG_RTX.
+            For example, if find_reloads sees that the input side of
+            a matched operand pair dies in this instruction, it may
+            use the input register as the reload register.
+
+            Calling forget_old_reloads_1 is a waste of effort if
+            REG_RTX is also the output register.
+
+            If we know that REG_RTX holds the value of a pseudo
+            register, the code after the call will record that fact.  */
+         if (rld[r].reg_rtx && rld[r].reg_rtx != out)
+           forget_old_reloads_1 (rld[r].reg_rtx, NULL_RTX, NULL);
+
          if (nregno >= FIRST_PSEUDO_REGISTER)
            {
              rtx src_reg, store_insn = NULL_RTX;