regclass.c (init_reg_modes): If we can't find a mode for the register, use the previo...
authorJason Merrill <jason@yorick.cygnus.com>
Tue, 7 Oct 1997 18:36:48 +0000 (18:36 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 7 Oct 1997 18:36:48 +0000 (14:36 -0400)
* regclass.c (init_reg_modes): If we can't find a mode for the
register, use the previous one.

From-SVN: r15862

gcc/ChangeLog
gcc/regclass.c

index c7eacd955edc54079623e53bf73d80dc27350e15..fb9cd7cf33289fae50de1069f800e07e867ca977 100644 (file)
@@ -1,3 +1,8 @@
+Tue Oct  7 11:00:42 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * regclass.c (init_reg_modes): If we can't find a mode for the 
+       register, use the previous one.
+
 Tue Oct  7 10:55:34 1997  Richard Henderson  <rth@cygnus.com>
 
        * haifa-sched.c (print_block_visualization): Call fprintf directly,
index f3bdc7ff997e364c8fde33929f8d8799a5204e41..2932db138100ff29dfe0a4a4624700c5d6990cb5 100644 (file)
@@ -405,14 +405,13 @@ init_reg_modes ()
     {
       reg_raw_mode[i] = choose_hard_reg_mode (i, 1);
 
-      /* If we couldn't find a valid mode, fall back to `word_mode'.
-        ??? We assume `word_mode' has already been initialized.
+      /* If we couldn't find a valid mode, just use the previous mode.
          ??? One situation in which we need to do this is on the mips where
         HARD_REGNO_NREGS (fpreg, [SD]Fmode) returns 2.  Ideally we'd like
         to use DF mode for the even registers and VOIDmode for the odd
         (for the cpu models where the odd ones are inaccessible).  */
       if (reg_raw_mode[i] == VOIDmode)
-       reg_raw_mode[i] = word_mode;
+       reg_raw_mode[i] = i == 0 ? word_mode : reg_raw_mode[i-1];
     }
 }