]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
reload1.c (choose_reload_regs): Check for invalid subregs before computing their...
authorDJ Delorie <dj@redhat.com>
Fri, 26 Jan 2007 01:15:05 +0000 (20:15 -0500)
committerDJ Delorie <dj@gcc.gnu.org>
Fri, 26 Jan 2007 01:15:05 +0000 (20:15 -0500)
* reload1.c (choose_reload_regs): Check for invalid subregs before
computing their locations, not after.

From-SVN: r121198

gcc/ChangeLog
gcc/reload1.c

index 0791bafb57eb998611fe29864f8d0dbf2a364d96..4cf04ef2a001695e9f93003bceb749a9bc3b8b0f 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-25  DJ Delorie  <dj@redhat.com>
+
+       * reload1.c (choose_reload_regs): Check for invalid subregs before
+       computing their locations, not after.
+
 2007-01-25  Geoffrey Keating  <geoffk@apple.com>
 
        PR 25127
index 8f7c703c41519038559c5a487c5be592d058982d..5598b7afdba57ab113996a3ad25589dc2b472a10 100644 (file)
@@ -5653,7 +5653,16 @@ choose_reload_regs (struct insn_chain *chain)
                regno = subreg_regno (rld[r].in);
 #endif
 
-             if (regno >= 0 && reg_last_reload_reg[regno] != 0)
+             if (regno >= 0
+                 && reg_last_reload_reg[regno] != 0
+#ifdef CANNOT_CHANGE_MODE_CLASS
+                 /* Verify that the register it's in can be used in
+                    mode MODE.  */
+                 && !REG_CANNOT_CHANGE_MODE_P (REGNO (reg_last_reload_reg[regno]),
+                                               GET_MODE (reg_last_reload_reg[regno]),
+                                               mode)
+#endif
+                 )
                {
                  enum reg_class class = rld[r].class, last_class;
                  rtx last_reg = reg_last_reload_reg[regno];
@@ -5673,13 +5682,6 @@ choose_reload_regs (struct insn_chain *chain)
 
                  if ((GET_MODE_SIZE (GET_MODE (last_reg))
                       >= GET_MODE_SIZE (need_mode))
-#ifdef CANNOT_CHANGE_MODE_CLASS
-                     /* Verify that the register in "i" can be obtained
-                        from LAST_REG.  */
-                     && !REG_CANNOT_CHANGE_MODE_P (REGNO (last_reg),
-                                                   GET_MODE (last_reg),
-                                                   mode)
-#endif
                      && reg_reloaded_contents[i] == regno
                      && TEST_HARD_REG_BIT (reg_reloaded_valid, i)
                      && HARD_REGNO_MODE_OK (i, rld[r].mode)