From: Richard Kenner Date: Fri, 23 Feb 2001 21:17:06 +0000 (+0000) Subject: diagnostic.c (trim_filename): No longer static. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fce687f8769fbad7fba74cf9adb985dd5369df01;p=gcc.git diagnostic.c (trim_filename): No longer static. * 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. From-SVN: r40016 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1daa8496399..43ce072896d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ Fri Feb 23 15:28:39 2001 Richard Kenner + * 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 24aa3489412..1863a2c3904 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 02bb8cbb8e6..37f58d779ec 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 dc36dd5b9d4..44772f35a44 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 4ef1441041b..012574ed244 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 */