This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
More fixes to error handling
- To: gcc-patches at gcc dot gnu dot org
- Subject: More fixes to error handling
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Fri, 23 Feb 01 16:20:49 EST
Calling error followed by fancy_abort isn't the same as calling internal_error.
I applied this in both the mainline and branch.
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.
*** diagnostic.c 2001/02/18 15:17:36 1.52
--- diagnostic.c 2001/02/23 19:27:14
*************** static void default_diagnostic_finalizer
*** 105,109 ****
static void error_recursion PARAMS ((void)) ATTRIBUTE_NORETURN;
- static const char *trim_filename PARAMS ((const char *));
extern int rtl_dump_and_exit;
--- 105,108 ----
*************** error_recursion ()
*** 1716,1720 ****
instead of `Internal compiler error in ../../GCC/gcc/expr.c'. */
! static const char *
trim_filename (name)
const char *name;
--- 1715,1719 ----
instead of `Internal compiler error in ../../GCC/gcc/expr.c'. */
! const char *
trim_filename (name)
const char *name;
*** rtl.c 2000/12/27 16:35:00 1.86
--- rtl.c 2001/02/23 19:27:37
*************** rtl_check_failed_bounds (r, n, file, lin
*** 1286,1292 ****
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);
}
--- 1286,1293 ----
const char *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);
}
*************** rtl_check_failed_type1 (r, n, c1, file,
*** 1300,1306 ****
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);
}
--- 1301,1308 ----
const char *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);
}
*************** rtl_check_failed_type2 (r, n, c1, c2, fi
*** 1315,1322 ****
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);
}
--- 1317,1324 ----
const char *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);
}
*************** rtl_check_failed_code1 (r, code, file, l
*** 1329,1335 ****
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);
}
--- 1331,1337 ----
const char *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);
}
*************** rtl_check_failed_code2 (r, code1, code2,
*** 1342,1349 ****
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);
}
--- 1344,1351 ----
const char *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);
}
*************** rtvec_check_failed_bounds (r, n, file, l
*** 1357,1363 ****
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);
}
#endif /* ENABLE_RTL_CHECKING */
--- 1359,1365 ----
const char *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 */
*** toplev.h 2001/02/16 13:03:10 1.54
--- toplev.h 2001/02/23 19:27:38
*************** extern void debug_define PARAMS ((unsig
*** 43,46 ****
--- 43,47 ----
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
*** tree.c 2001/02/11 19:04:31 1.185
--- tree.c 2001/02/23 19:27:48
*************** tree_check_failed (node, code, file, lin
*** 4664,4670 ****
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);
}
--- 4664,4670 ----
const char *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);
}
*************** tree_class_check_failed (node, cl, file,
*** 4680,4687 ****
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);
}
--- 4680,4687 ----
const char *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);
}