reload1.c (choose_reload_regs): Also try inheritance when reload_in is a stack slot...
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Thu, 24 Sep 1998 13:58:43 +0000 (13:58 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Thu, 24 Sep 1998 13:58:43 +0000 (14:58 +0100)
* reload1.c (choose_reload_regs): Also try inheritance when
reload_in is a stack slot of a pseudo, even if we already got a
reload reg.

From-SVN: r22571

gcc/ChangeLog
gcc/reload1.c

index c462638335940df996a93a709d950128ec9b00d1..0b9d673dc94be82a58af7e67cd7fe326a024be55 100644 (file)
@@ -1,3 +1,9 @@
+Thu Sep 24 21:48:51 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * reload1.c (choose_reload_regs): Also try inheritance when
+       reload_in is a stack slot of a pseudo, even if we already got a
+       reload reg.
+
 Thu Sep 24 21:22:39 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * reload1.c (reload_cse_regs_1): Renamed from reload_cse_regs.
index 91b7294a6ff87c8c654be55a13f5526339ea3c8e..bb7aa3fcfd805a5fd72c22fe1866dd40d9c05c86 100644 (file)
@@ -5675,13 +5675,16 @@ choose_reload_regs (insn, avoid_return_reg)
              && ! reload_secondary_p[r])
            continue;
 
-         /* If find_reloads chose to use reload_in or reload_out as a reload
+         /* If find_reloads chose to use reload_in or reload_out as a reload
             register, we don't need to chose one.  Otherwise, try even if it
             found one since we might save an insn if we find the value lying
-            around.  */
+            around.
+            Try also when reload_in is a pseudo without a hard reg.  */
          if (reload_in[r] != 0 && reload_reg_rtx[r] != 0
              && (rtx_equal_p (reload_in[r], reload_reg_rtx[r])
-                 || rtx_equal_p (reload_out[r], reload_reg_rtx[r])))
+                 || (rtx_equal_p (reload_out[r], reload_reg_rtx[r])
+                     && GET_CODE (reload_in[r]) != MEM
+                     && true_regnum (reload_in[r]) < FIRST_PSEUDO_REGISTER)))
            continue;
 
 #if 0 /* No longer needed for correct operation.
@@ -5827,7 +5830,13 @@ choose_reload_regs (insn, avoid_return_reg)
                              /* Don't really use the inherited spill reg
                                 if we need it wider than we've got it.  */
                              || (GET_MODE_SIZE (reload_mode[r])
-                                 > GET_MODE_SIZE (mode)))
+                                 > GET_MODE_SIZE (mode))
+                             /* If find_reloads chose reload_out as reload
+                                register, stay with it - that leaves the
+                                inherited register for subsequent reloads.  */
+                             || (reload_reg_rtx
+                                 && rtx_equal_p (reload_out[r],
+                                                 reload_reg_rtx[r])))
                            reload_override_in[r] = reg_last_reload_reg[regno];
                          else
                            {