aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMichael Meissner <meissner@gcc.gnu.org>1994-09-02 02:12:48 +0000
committerMichael Meissner <meissner@gcc.gnu.org>1994-09-02 02:12:48 +0000
commita89b2cc4581e43f3b1f728d38bc4a23769ce63f3 (patch)
tree9a91163236ad0bacfbab31697da5ea6df0b1f13f /gcc
parentac83e1bb1c764477e399672ca27e7ff0ec1fb736 (diff)
downloadgcc-a89b2cc4581e43f3b1f728d38bc4a23769ce63f3.zip
gcc-a89b2cc4581e43f3b1f728d38bc4a23769ce63f3.tar.gz
gcc-a89b2cc4581e43f3b1f728d38bc4a23769ce63f3.tar.bz2
Add better error messages than abort to reload1, and print insn involed.
From-SVN: r8016
Diffstat (limited to 'gcc')
-rw-r--r--gcc/genextract.c2
-rw-r--r--gcc/reload1.c11
-rw-r--r--gcc/rtl.h4
-rw-r--r--gcc/toplev.c27
4 files changed, 29 insertions, 15 deletions
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 3234d4e..9a608cb 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -447,8 +447,6 @@ from the machine description file `md'. */\n\n");
printf ("extern rtx *recog_operand_loc[];\n");
printf ("extern rtx *recog_dup_loc[];\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 (" rtx insn;\n");
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 999b5e3..c56710e 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1153,7 +1153,8 @@ reload (first, global, dumpfile)
if (other_mode != VOIDmode && other_mode != allocate_mode
&& ! modes_equiv_for_class_p (allocate_mode,
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)
{
@@ -2163,7 +2164,7 @@ spill_failure (insn)
if (asm_noperands (PATTERN (insn)) >= 0)
error_for_asm (insn, "`asm' needs too many reloads");
else
- abort ();
+ fatal_insn ("Unable to find a register to spill.", insn);
}
/* Add a new register to the tables of available spill-registers
@@ -3848,7 +3849,7 @@ reload_as_needed (first, live_known)
&& ! reload_optional[i]
&& (reload_in[i] != 0 || reload_out[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
reusing reload regs from previous insns, or else output
@@ -4844,7 +4845,7 @@ allocate_reload_reg (r, insn, last_reload, noerror)
failure:
if (asm_noperands (PATTERN (insn)) < 0)
/* 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
don't match. Disable this reload so we don't crash in final. */
@@ -6298,7 +6299,7 @@ emit_reload_insns (insn)
/* VOIDmode should never happen for an output. */
if (asm_noperands (PATTERN (insn)) < 0)
/* It's the compiler's fault. */
- abort ();
+ fatal_insn ("VOIDmode on an output", insn);
error_for_asm (insn, "output operand is constant in `asm'");
/* Prevent crash--use something we know is valid. */
mode = word_mode;
diff --git a/gcc/rtl.h b/gcc/rtl.h
index b0eb1c5..8e8a026 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -922,6 +922,10 @@ extern rtx output_constant_def PROTO((union tree_node *));
extern rtx immed_real_const PROTO((union tree_node *));
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. */
#ifndef STORE_FLAG_VALUE
diff --git a/gcc/toplev.c b/gcc/toplev.c
index b08149b..5406a50 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -944,20 +944,17 @@ fatal_io_error (name)
exit (35);
}
-/* 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(). */
+/* Called to give a better error message for a bad insn rather than
+ just calling abort(). */
void
-fatal_insn_not_found (insn)
+fatal_insn (message, insn)
+ char *message;
rtx insn;
{
if (!output_bytecode)
{
- if (INSN_CODE (insn) < 0)
- error ("internal error--unrecognizable insn:");
- else
- error ("internal error--insn does not satisfy its constraints:");
+ error (message);
debug_rtx (insn);
}
if (asm_out_file)
@@ -995,6 +992,20 @@ fatal_insn_not_found (insn)
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. */
static char *