reload1.c (eliminate_regs_in_insn): When updating a set to the frame pointer to the...
authorGeoffrey Keating <geoffk@redhat.com>
Thu, 19 Jul 2001 19:46:29 +0000 (19:46 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Thu, 19 Jul 2001 19:46:29 +0000 (19:46 +0000)
* reload1.c (eliminate_regs_in_insn): When updating a set
to the frame pointer to the hardware frame pointer, perform
the update always not just when REPLACE is set.

From-SVN: r44161

gcc/ChangeLog
gcc/reload1.c

index f8f9e2fb57b95370f3f09e27587219966275d4bb..0a967bccd206fcb10d2d60706dd79ff97e292a51 100644 (file)
@@ -1,5 +1,9 @@
 2001-07-19  Geoffrey Keating  <geoffk@redhat.com>
 
+       * reload1.c (eliminate_regs_in_insn): When updating a set
+       to the frame pointer to the hardware frame pointer, perform
+       the update always not just when REPLACE is set.
+
        * reload1.c (choose_reload_regs): Don't inherit a reload
        that crosses multiple registers if registers past the first
        don't fit in the desired class.
index 94eccfe1974a5d3e94102381d2e0376104cdd49c..ced823b0c1b58c8a2500af41214417ff9e4dbff0 100644 (file)
@@ -2962,22 +2962,29 @@ eliminate_regs_in_insn (insn, replace)
 
                if (ok)
                  {
-                   if (replace)
+                   rtx src
+                     = plus_constant (ep->to_rtx, offset - ep->offset);
+
+                   new_body = old_body;
+                   if (! replace)
+                     {
+                       new_body = copy_insn (old_body);
+                       if (REG_NOTES (insn))
+                         REG_NOTES (insn) = copy_insn_1 (REG_NOTES (insn));
+                     }
+                   PATTERN (insn) = new_body;
+                   old_set = single_set (insn);
+
+                   /* First see if this insn remains valid when we
+                      make the change.  If not, keep the INSN_CODE
+                      the same and let reload fit it up.  */
+                   validate_change (insn, &SET_SRC (old_set), src, 1);
+                   validate_change (insn, &SET_DEST (old_set),
+                                    ep->to_rtx, 1);
+                   if (! apply_change_group ())
                      {
-                       rtx src
-                         = plus_constant (ep->to_rtx, offset - ep->offset);
-
-                       /* First see if this insn remains valid when we
-                          make the change.  If not, keep the INSN_CODE
-                          the same and let reload fit it up.  */
-                       validate_change (insn, &SET_SRC (old_set), src, 1);
-                       validate_change (insn, &SET_DEST (old_set),
-                                        ep->to_rtx, 1);
-                       if (! apply_change_group ())
-                         {
-                           SET_SRC (old_set) = src;
-                           SET_DEST (old_set) = ep->to_rtx;
-                         }
+                       SET_SRC (old_set) = src;
+                       SET_DEST (old_set) = ep->to_rtx;
                      }
 
                    val = 1;