diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1daa849639900fc6a69a5b7673e1a59e856bf8e7..43ce072896da906177816f30691319e088abe832 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
 Fri Feb 23 15:28:39 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+	* diagnostic.c (trim_filename): No longer static.
+	* toplev.h (trim_filename): Declare.
+	* rtl.c (rtl_check_failed_bounds): Call internal_error.
+	(rtl_check_failed_type1, rtl_check_failed_type2): Likewise.
+	(rtl_check_failed_code1, rtl_check_failed_code2): Likewise.
+	(rtvec_check_failed_bounds): Likewise.
+	* tree.c (tree_check_failed, tree_class_check_failed): Likewise.
+
 	* convert.c (convert_to_integer): Don't do unsigned unless result or
 	both inputs are unsigned.
 
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 24aa348941244f70f6b4ddb799128e60212ed65d..1863a2c39045e0b218ec55c5c9e95e0a70287d6e 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -104,7 +104,6 @@ static void default_diagnostic_finalizer PARAMS ((output_buffer *,
                                                   diagnostic_context *));
 
 static void error_recursion PARAMS ((void)) ATTRIBUTE_NORETURN;
-static const char *trim_filename PARAMS ((const char *));
 
 extern int rtl_dump_and_exit;
 extern int inhibit_warnings;
@@ -1716,7 +1715,7 @@ error_recursion ()
    is used by fancy_abort() to print `Internal compiler error in expr.c'
    instead of `Internal compiler error in ../../GCC/gcc/expr.c'.  */
 
-static const char *
+const char *
 trim_filename (name)
      const char *name;
 {
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 02bb8cbb8e6970ed0ffdacb0f0accd12fb72eaf6..37f58d779ecd60dce9365199a64b347c573cd60a 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -1285,9 +1285,10 @@ rtl_check_failed_bounds (r, n, file, line, func)
     int line;
     const char *func;
 {
-  error ("RTL check: access of elt %d of `%s' with last elt %d",
-	 n, GET_RTX_NAME (GET_CODE (r)), GET_RTX_LENGTH (GET_CODE (r))-1);
-  fancy_abort (file, line, func);
+  internal_error
+    ("RTL check: access of elt %d of `%s' with last elt %d in %s, at %s:%d",
+     n, GET_RTX_NAME (GET_CODE (r)), GET_RTX_LENGTH (GET_CODE (r)) - 1,
+     func, trim_filename (file), line);
 }
 
 void
@@ -1299,9 +1300,10 @@ rtl_check_failed_type1 (r, n, c1, file, line, func)
     int line;
     const char *func;
 {
-  error ("RTL check: expected elt %d type '%c', have '%c' (rtx %s)",
-	 n, c1, GET_RTX_FORMAT (GET_CODE (r))[n], GET_RTX_NAME (GET_CODE (r)));
-  fancy_abort (file, line, func);
+  internal_error
+    ("RTL check: expected elt %d type '%c', have '%c' (rtx %s) in %s, at %s:%d",
+     n, c1, GET_RTX_FORMAT (GET_CODE (r))[n], GET_RTX_NAME (GET_CODE (r)),
+     func, trim_filename (file), line);
 }
 
 void
@@ -1314,10 +1316,10 @@ rtl_check_failed_type2 (r, n, c1, c2, file, line, func)
     int line;
     const char *func;
 {
-  error ("RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s)",
-	 n, c1, c2,
-	 GET_RTX_FORMAT (GET_CODE (r))[n], GET_RTX_NAME (GET_CODE(r)));
-  fancy_abort (file, line, func);
+  internal_error
+    ("RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s) in %s, at %s:%d",
+     n, c1, c2, GET_RTX_FORMAT (GET_CODE (r))[n], GET_RTX_NAME (GET_CODE (r)),
+     func, trim_filename (file), line);
 }
 
 void
@@ -1328,9 +1330,9 @@ rtl_check_failed_code1 (r, code, file, line, func)
     int line;
     const char *func;
 {
-  error ("RTL check: expected code `%s', have `%s'",
- 	 GET_RTX_NAME (code), GET_RTX_NAME (GET_CODE (r)));
-  fancy_abort (file, line, func);
+  internal_error ("RTL check: expected code `%s', have `%s' in %s, at %s:%d",
+		  GET_RTX_NAME (code), GET_RTX_NAME (GET_CODE (r)), func,
+		  trim_filename (file), line);
 }
 
 void
@@ -1341,10 +1343,10 @@ rtl_check_failed_code2 (r, code1, code2, file, line, func)
     int line;
     const char *func;
 {
-  error ("RTL check: expected code `%s' or `%s', have `%s'",
- 	 GET_RTX_NAME (code1), GET_RTX_NAME (code2),
-	 GET_RTX_NAME (GET_CODE (r)));
-  fancy_abort (file, line, func);
+  internal_error
+    ("RTL check: expected code `%s' or `%s', have `%s' in %s, at %s:%d",
+     GET_RTX_NAME (code1), GET_RTX_NAME (code2), GET_RTX_NAME (GET_CODE (r)),
+     ffunc, trim_filename (file), line);
 }
 
 /* XXX Maybe print the vector?  */
@@ -1356,8 +1358,8 @@ rtvec_check_failed_bounds (r, n, file, line, func)
     int line;
     const char *func;
 {
-  error ("RTL check: access of elt %d of vector with last elt %d",
-	 n, GET_NUM_ELEM (r)-1);
-  fancy_abort (file, line, func);
+  internal_error
+    ("RTL check: access of elt %d of vector with last elt %d in %s, at %s:%d",
+     n, GET_NUM_ELEM (r) - 1, func, trim_filename (file), line);
 }
 #endif /* ENABLE_RTL_CHECKING */
diff --git a/gcc/toplev.h b/gcc/toplev.h
index dc36dd5b9d4d7b32643e59f9198b1faf8fadef54..44772f35a44bec7101f501e24858b67a4c5f9e45 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -42,6 +42,7 @@ extern void debug_end_source_file	PARAMS ((unsigned));
 extern void debug_define		PARAMS ((unsigned, const char *));
 extern void debug_undef			PARAMS ((unsigned, const char *));
 extern int debug_ignore_block		PARAMS ((union tree_node *));
+extern const char *trim_filename	PARAMS ((const char *));
 extern void internal_error		PARAMS ((const char *, ...))
 					       ATTRIBUTE_PRINTF_1
 					       ATTRIBUTE_NORETURN;
diff --git a/gcc/tree.c b/gcc/tree.c
index 4ef1441041b0b87e7ec0e64f7a8f9d59ba1d6eab..012574ed2445ec9d59ebb9ebab97ebe528728dfa 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4663,9 +4663,9 @@ tree_check_failed (node, code, file, line, function)
      int line;
      const char *function;
 {
-  error ("Tree check: expected %s, have %s",
-	 tree_code_name[code], tree_code_name[TREE_CODE (node)]);
-  fancy_abort (file, line, function);
+  internal_error ("Tree check: expected %s, have %s in %s, at %s:%d",
+		  tree_code_name[code], tree_code_name[TREE_CODE (node)],
+		  function, trim_filename (file), line);
 }
 
 /* Similar to above, except that we check for a class of tree
@@ -4679,10 +4679,10 @@ tree_class_check_failed (node, cl, file, line, function)
      int line;
      const char *function;
 {
-  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);
+  internal_error
+    ("Tree check: expected class '%c', have '%c' (%s) in %s, at %s:%d",
+     cl, TREE_CODE_CLASS (TREE_CODE (node)),
+     tree_code_name[TREE_CODE (node)], function, trim_filename (file), line);
 }
 
 #endif /* ENABLE_TREE_CHECKING */