(push_reload): Move the NO_REGS abort after the error check for asms, to avoid crashi...
authorRichard Stallman <rms@gnu.org>
Wed, 30 Dec 1992 07:28:37 +0000 (07:28 +0000)
committerRichard Stallman <rms@gnu.org>
Wed, 30 Dec 1992 07:28:37 +0000 (07:28 +0000)
(push_reload): Move the NO_REGS abort after the
error check for asms, to avoid crashing for asms.
Fix inmode and outmode too, if they are VOID for an asm.

From-SVN: r2989

gcc/reload.c

index f9b0a0ce3c3ac2576d06e291fa467210c7a484a0..7757dd7f0454b64942bc0207925d71379ea219b9 100644 (file)
@@ -695,9 +695,6 @@ push_reload (in, out, inloc, outloc, class,
     class = LIMIT_RELOAD_CLASS (GET_MODE (SUBREG_REG (out)), class);
 #endif
 
-  if (class == NO_REGS)
-    abort ();
-
   /* Verify that this class is at least possible for the mode that
      is specified.  */
   if (this_insn_is_asm)
@@ -707,6 +704,15 @@ push_reload (in, out, inloc, outloc, class,
        mode = inmode;
       else
        mode = outmode;
+      if (mode == VOIDmode)
+       {
+         error_for_asm (this_insn, "cannot reload integer constant operand in `asm'");
+         mode = word_mode;
+         if (in != 0)
+           inmode = word_mode;
+         if (out != 0)
+           outmode = word_mode;
+       }
       for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
        if (HARD_REGNO_MODE_OK (i, mode)
            && TEST_HARD_REG_BIT (reg_class_contents[(int) class], i))
@@ -727,6 +733,9 @@ push_reload (in, out, inloc, outloc, class,
        }
     }
 
+  if (class == NO_REGS)
+    abort ();
+
   /* We can use an existing reload if the class is right
      and at least one of IN and OUT is a match
      and the other is at worst neutral.