]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
toplev.c (compile_file): Call init_regs after `word_mode' is valid.
authorDoug Evans <dje@gnu.org>
Fri, 27 May 1994 23:29:18 +0000 (23:29 +0000)
committerDoug Evans <dje@gnu.org>
Fri, 27 May 1994 23:29:18 +0000 (23:29 +0000)
* toplev.c (compile_file): Call init_regs after `word_mode' is valid.
* regclass.c (init_reg_modes): If choose_hard_reg_mode can't find a
valid mode, fall back to word_mode.

From-SVN: r7379

gcc/regclass.c
gcc/toplev.c

index 2c2c36ff5d3f6e681042b982604fcfe43098dcea..bef30abe539995d4a1e0db5d7b6ab38f875a267c 100644 (file)
@@ -402,7 +402,18 @@ init_reg_modes ()
   register int i;
 
   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-    reg_raw_mode[i] = choose_hard_reg_mode (i, 1);
+    {
+      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.
+         ??? 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 inaccessable).  */
+      if (reg_raw_mode[i] == VOIDmode)
+       reg_raw_mode[i] = word_mode;
+    }
 }
 
 /* Finish initializing the register sets and
index ec0baa4abdd2bc32b15c613fecc60808201e2d41..2a759574b7a012032b92044800935f7e43e7451f 100644 (file)
@@ -2026,9 +2026,9 @@ compile_file (name)
   /* Some of these really don't need to be called when generating bytecode,
      but the options would have to be parsed first to know that. -bson */
   init_rtl ();
-  init_regs ();
   init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL
                  || debug_info_level == DINFO_LEVEL_VERBOSE);
+  init_regs ();
   init_decl_processing ();
   init_optabs ();
   init_stmt ();