OSDN Git Service

(emit_reload_insns): Error instead of abort
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Dec 1992 07:29:06 +0000 (07:29 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Dec 1992 07:29:06 +0000 (07:29 +0000)
if an asm has a VOIDmode output operand.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2990 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/reload1.c

index 75738ef..6d66504 100644 (file)
@@ -5339,7 +5339,16 @@ emit_reload_insns (insn)
 
          mode = GET_MODE (old);
          if (mode == VOIDmode)
-           abort ();           /* Should never happen for an output.  */
+           {
+             /* VOIDmode should never happen for an output.  */
+             if (asm_noperands (PATTERN (insn)) < 0)
+               /* It's the compiler's fault.  */
+               abort ();
+             error_for_asm (insn, "output operand is constant in `asm'");
+             /* Prevent crash--use something we know is valid.  */
+             mode = word_mode;
+             old = gen_rtx (REG, mode, REGNO (reloadreg));
+           }
 
          /* A strict-low-part output operand needs to be reloaded
             in the mode of the entire value.  */