aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@bitmover.com>1999-08-26 05:18:44 +0000
committerZack Weinberg <zack@gcc.gnu.org>1999-08-26 05:18:44 +0000
commit987009bf0d31f2aa399cbf58ddf91a90b09848ca (patch)
treed44a531d6d8a1d3b4f321e6fc43e9e6dbb2f1277 /gcc/tree.c
parentf18a14bcc121ed9812ecba53b3a458ed3d16953f (diff)
downloadgcc-987009bf0d31f2aa399cbf58ddf91a90b09848ca.zip
gcc-987009bf0d31f2aa399cbf58ddf91a90b09848ca.tar.gz
gcc-987009bf0d31f2aa399cbf58ddf91a90b09848ca.tar.bz2
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com> * system.h: Don't redefine abort or trim_filename. * rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0) or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on whether or not __FUNCTION__ is available. * tree.h: Duplicate rtl.h's definition of abort, for files that don't include rtl.h. Delete all code to perform type checking with a compiler other than GCC. * varray.h: Delete all code to perform type checking with a compiler other than GCC. Make VARRAY_CHECK() always evaluate its arguments exactly once, using a statement expression. Adjust the VARRAY_<type> accessor macros to match. * toplev.h (fatal_insn, fatal_insn_not_found): Kill. (_fatal_insn, _fatal_insn_not_found): New fns, take info on caller's location. Define fatal_insn and fatal_insn_not_found as macros that use _fatal_insn and _fatal_insn_not_found. (fancy_abort, trim_filename): Kill prototypes. * rtl.c (trim_filename): Move here from toplev.c. (fancy_abort): New function. (DIR_SEPARATOR): Provide default definition. * tree.c (tree_check_failed, tree_class_check_failed): Go through fancy_abort. (tree_check, tree_class_check, cst_or_constructor_check, expr_check): Delete. * varray.c (varray_check_failed): New function. * toplev.c (fatal_insn, fatal_insn_not_found): Replace with _fatal_insn and _fatal_insn_not_found. Go through fancy_abort. (trim_filename, fancy_abort): Delete. * builtins.c (expand_builtin_args_info): Report ICE with abort. * except.c (start_catch_handler): Report ICE with error/abort combo. * final.c (output_operand_lossage): Likewise. * flow.c (verify_flow_info): Likewise. * gcc.c: Prototype fatal. * gengenrtl.c: Undef abort after including rtl.h not system.h. * genattr.c, genattrtab.c, genemit.c, genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c: Don't define fancy_abort. From-SVN: r28889
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c89
1 files changed, 7 insertions, 82 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index fb8f08a..aca04f6 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5073,14 +5073,9 @@ get_set_constructor_bytes (init, buffer, wd_size)
return non_const_bits;
}
-#ifdef ENABLE_CHECKING
-
-#if defined __GNUC__ && (__GNUC__ > 2 || __GNUC_MINOR__ > 6)
-
+#if defined ENABLE_CHECKING && (__GNUC__ > 2 || __GNUC_MINOR__ > 6)
/* Complain that the tree code of NODE does not match the expected CODE.
- FILE, LINE, and FUNCTION are of the caller.
-
- FIXME: should print the blather about reporting the bug. */
+ FILE, LINE, and FUNCTION are of the caller. */
void
tree_check_failed (node, code, file, line, function)
const tree node;
@@ -5089,10 +5084,9 @@ tree_check_failed (node, code, file, line, function)
int line;
const char *function;
{
- fatal ("Internal compiler error in `%s', at %s:%d:\n\
-\texpected %s, have %s\n",
- function, trim_filename (file), line,
+ error ("Tree check: expected %s, have %s",
tree_code_name[code], tree_code_name[TREE_CODE (node)]);
+ fancy_abort (file, line, function);
}
/* Similar to above, except that we check for a class of tree
@@ -5105,81 +5099,12 @@ tree_class_check_failed (node, cl, file, line, function)
int line;
const char *function;
{
- fatal ("Internal compiler error in `%s', at %s:%d:\n\
-\texpected '%c', have '%c' (%s)\n",
- function, trim_filename (file), line, cl,
- TREE_CODE_CLASS (TREE_CODE (node)),
+ error ("Tree check: expected class '%c', have '%c' (%s)",
+ cl, TREE_CODE_CLASS (TREE_CODE (node)),
tree_code_name[TREE_CODE (node)]);
+ fancy_abort (file, line, function);
}
-#else /* not gcc or old gcc */
-
-/* These functions are just like the above, but they have to
- do the check as well as report the error. */
-tree
-tree_check (node, code, file, line)
- const tree node;
- enum tree_code code;
- const char *file;
- int line;
-{
- if (TREE_CODE (node) == code)
- return node;
-
- fatal ("Internal compiler error at %s:%d:\n\texpected %s, have %s\n",
- file, trim_filename (file), tree_code_name[code], tree_code_name[TREE_CODE(node)]);
-}
-
-tree
-tree_class_check (node, class, file, line)
- const tree node;
- char class;
- const char *file;
- int line;
-{
- if (TREE_CODE_CLASS (TREE_CODE (node)) == class)
- return node;
-
- fatal ("Internal compiler error at %s:%d:\n\
-\texpected '%c', have '%c' (%s)\n",
- file, trim_filename (file), class, TREE_CODE_CLASS (TREE_CODE (node)),
- tree_code_name[TREE_CODE(node)]);
-}
-
-tree
-cst_or_constructor_check (node, file, line)
- const tree node;
- const char *file;
- int line;
-{
- enum tree_code code = TREE_CODE (node);
-
- if (code == CONSTRUCTOR || TREE_CODE_CLASS (code) == 'c')
- return node;
-
- fatal ("Internal compiler error at %s:%d:\n\
-\texpected constructor, have %s\n",
- file, line, tree_code_name[code]);
-}
-
-tree
-expr_check (node, file, line)
- const tree node;
- const char *file;
- int line;
-{
- char c = TREE_CODE_CLASS (TREE_CODE (node));
-
- if (c == 'r' || c == 's' || c == '<'
- || c == '1' || c == '2' || c == 'e')
- return node;
-
- fatal ("Internal compiler error at %s:%d:\n\
-\texpected 'e', have '%c' (%s)\n",
- file, trim_filename (file), c, tree_code_name[TREE_CODE (node)]);
-}
-
-#endif /* not gcc or old gcc */
#endif /* ENABLE_CHECKING */
/* Return the alias set for T, which may be either a type or an