Commit a89b2cc4 by Michael Meissner

Add better error messages than abort to reload1, and print insn involed.

From-SVN: r8016
parent ac83e1bb
...@@ -447,8 +447,6 @@ from the machine description file `md'. */\n\n"); ...@@ -447,8 +447,6 @@ from the machine description file `md'. */\n\n");
printf ("extern rtx *recog_operand_loc[];\n"); printf ("extern rtx *recog_operand_loc[];\n");
printf ("extern rtx *recog_dup_loc[];\n"); printf ("extern rtx *recog_dup_loc[];\n");
printf ("extern char recog_dup_num[];\n"); printf ("extern char recog_dup_num[];\n");
printf ("extern\n#ifdef __GNUC__\n__volatile__\n#endif\n");
printf ("void fatal_insn_not_found ();\n\n");
printf ("void\ninsn_extract (insn)\n"); printf ("void\ninsn_extract (insn)\n");
printf (" rtx insn;\n"); printf (" rtx insn;\n");
......
...@@ -1153,7 +1153,8 @@ reload (first, global, dumpfile) ...@@ -1153,7 +1153,8 @@ reload (first, global, dumpfile)
if (other_mode != VOIDmode && other_mode != allocate_mode if (other_mode != VOIDmode && other_mode != allocate_mode
&& ! modes_equiv_for_class_p (allocate_mode, && ! modes_equiv_for_class_p (allocate_mode,
other_mode, class)) other_mode, class))
abort (); fatal_insn ("Two dissimilar machine modes both need groups of consecutive regs of the same class",
insn);
} }
else if (size == 1) else if (size == 1)
{ {
...@@ -2163,7 +2164,7 @@ spill_failure (insn) ...@@ -2163,7 +2164,7 @@ spill_failure (insn)
if (asm_noperands (PATTERN (insn)) >= 0) if (asm_noperands (PATTERN (insn)) >= 0)
error_for_asm (insn, "`asm' needs too many reloads"); error_for_asm (insn, "`asm' needs too many reloads");
else else
abort (); fatal_insn ("Unable to find a register to spill.", insn);
} }
/* Add a new register to the tables of available spill-registers /* Add a new register to the tables of available spill-registers
...@@ -3848,7 +3849,7 @@ reload_as_needed (first, live_known) ...@@ -3848,7 +3849,7 @@ reload_as_needed (first, live_known)
&& ! reload_optional[i] && ! reload_optional[i]
&& (reload_in[i] != 0 || reload_out[i] != 0 && (reload_in[i] != 0 || reload_out[i] != 0
|| reload_secondary_p[i] != 0)) || reload_secondary_p[i] != 0))
abort (); fatal_insn ("Non-optional registers need a spill register", insn);
/* Now compute which reload regs to reload them into. Perhaps /* Now compute which reload regs to reload them into. Perhaps
reusing reload regs from previous insns, or else output reusing reload regs from previous insns, or else output
...@@ -4844,7 +4845,7 @@ allocate_reload_reg (r, insn, last_reload, noerror) ...@@ -4844,7 +4845,7 @@ allocate_reload_reg (r, insn, last_reload, noerror)
failure: failure:
if (asm_noperands (PATTERN (insn)) < 0) if (asm_noperands (PATTERN (insn)) < 0)
/* It's the compiler's fault. */ /* It's the compiler's fault. */
abort (); fatal_insn ("Could not find a spill register", insn);
/* It's the user's fault; the operand's mode and constraint /* It's the user's fault; the operand's mode and constraint
don't match. Disable this reload so we don't crash in final. */ don't match. Disable this reload so we don't crash in final. */
...@@ -6298,7 +6299,7 @@ emit_reload_insns (insn) ...@@ -6298,7 +6299,7 @@ emit_reload_insns (insn)
/* VOIDmode should never happen for an output. */ /* VOIDmode should never happen for an output. */
if (asm_noperands (PATTERN (insn)) < 0) if (asm_noperands (PATTERN (insn)) < 0)
/* It's the compiler's fault. */ /* It's the compiler's fault. */
abort (); fatal_insn ("VOIDmode on an output", insn);
error_for_asm (insn, "output operand is constant in `asm'"); error_for_asm (insn, "output operand is constant in `asm'");
/* Prevent crash--use something we know is valid. */ /* Prevent crash--use something we know is valid. */
mode = word_mode; mode = word_mode;
......
...@@ -922,6 +922,10 @@ extern rtx output_constant_def PROTO((union tree_node *)); ...@@ -922,6 +922,10 @@ extern rtx output_constant_def PROTO((union tree_node *));
extern rtx immed_real_const PROTO((union tree_node *)); extern rtx immed_real_const PROTO((union tree_node *));
extern union tree_node *make_tree PROTO((union tree_node *, rtx)); extern union tree_node *make_tree PROTO((union tree_node *, rtx));
/* Abort routines */
extern void fatal_insn_not_found PROTO((rtx));
extern void fatal_insn PROTO((char *, rtx));
/* Define a default value for STORE_FLAG_VALUE. */ /* Define a default value for STORE_FLAG_VALUE. */
#ifndef STORE_FLAG_VALUE #ifndef STORE_FLAG_VALUE
......
...@@ -944,20 +944,17 @@ fatal_io_error (name) ...@@ -944,20 +944,17 @@ fatal_io_error (name)
exit (35); exit (35);
} }
/* Called to give a better error message when we don't have an insn to match /* Called to give a better error message for a bad insn rather than
what we are looking for or if the insn's constraints aren't satisfied, just calling abort(). */
rather than just calling abort(). */
void void
fatal_insn_not_found (insn) fatal_insn (message, insn)
char *message;
rtx insn; rtx insn;
{ {
if (!output_bytecode) if (!output_bytecode)
{ {
if (INSN_CODE (insn) < 0) error (message);
error ("internal error--unrecognizable insn:");
else
error ("internal error--insn does not satisfy its constraints:");
debug_rtx (insn); debug_rtx (insn);
} }
if (asm_out_file) if (asm_out_file)
...@@ -995,6 +992,20 @@ fatal_insn_not_found (insn) ...@@ -995,6 +992,20 @@ fatal_insn_not_found (insn)
abort (); abort ();
} }
/* Called to give a better error message when we don't have an insn to match
what we are looking for or if the insn's constraints aren't satisfied,
rather than just calling abort(). */
void
fatal_insn_not_found (insn)
rtx insn;
{
if (INSN_CODE (insn) < 0)
fatal_insn ("internal error--unrecognizable insn:", insn);
else
fatal_insn ("internal error--insn does not satisfy its constraints:", insn);
}
/* This is the default decl_printable_name function. */ /* This is the default decl_printable_name function. */
static char * static char *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment