Fix computation of need_mode in choose_reload_regs.
authorBernd Schmidt <bernds@redhat.co.uk>
Fri, 8 Sep 2000 09:41:07 +0000 (09:41 +0000)
committerBernd Schmidt <crux@gcc.gnu.org>
Fri, 8 Sep 2000 09:41:07 +0000 (09:41 +0000)
From-SVN: r36264

gcc/ChangeLog
gcc/reload1.c

index 6e2837b660a3b4d4433eb41cbc690a87f892bee3..288f380afda9dadd0f56d2057fb6276db4daf1a1 100644 (file)
@@ -2,6 +2,8 @@
 
        * combine.c (combine_simplify_rtx): Try to simplify VEC_SELECT of a
        VEC_CONCAT.
+       From Richard Henderson:
+       * reload1.c (choose_reload_regs): Compute need_mode properly.
 
 2000-09-07  Richard Henderson  <rth@cygnus.com>
 
index b09f9eb8222b6f2f0f0e55a168123b0e19057eed..fb840477ba76097ee6651e007aff89c6137cd9d7 100644 (file)
@@ -5304,8 +5304,13 @@ choose_reload_regs (chain)
                  i = REGNO (last_reg) + word;
                  last_class = REGNO_REG_CLASS (i);
 
-                 need_mode = smallest_mode_for_size ((word+1) * UNITS_PER_WORD,
-                                                     GET_MODE_CLASS (mode));
+                 if (word == 0)
+                   need_mode = mode;
+                 else
+                   need_mode
+                     = smallest_mode_for_size (GET_MODE_SIZE (mode)
+                                               + word * UNITS_PER_WORD,
+                                               GET_MODE_CLASS (mode));
 
                  if (
 #ifdef CLASS_CANNOT_CHANGE_MODE