Ping. The patch is the same, so I didn't attach it again. It may be found at http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01174.html . I think I've replied to all comments.
Ian ---------- Forwarded message ---------- From: Ian Lance Taylor <i...@google.com> Date: Mon, Sep 17, 2012 at 10:17 AM Subject: PATCH RFA: Print backtrace on ICE To: gcc-patches@gcc.gnu.org This patch to the diagnostic code uses the new backtrace library to print a backtrace on an ICE. For example, here is the output of a test case I took from a C++ PR: /home/iant/foo2.cc:6:6: internal compiler error: in cp_lexer_new_from_tokens, at cp/parser.c:638 0xec549f internal_error(char const*, ...) ../../trunk/gcc/diagnostic.c:1057 0xec3f53 fancy_abort(char const*, int, char const*) ../../trunk/gcc/diagnostic.c:1111 0x5ff78e cp_lexer_new_from_tokens ../../trunk/gcc/cp/parser.c:638 0x5ff78e cp_parser_push_lexer_for_tokens ../../trunk/gcc/cp/parser.c:3290 0x60ff40 cp_parser_late_parsing_for_member ../../trunk/gcc/cp/parser.c:21713 0x60ff40 cp_parser_class_specifier_1 ../../trunk/gcc/cp/parser.c:18207 0x60ff40 cp_parser_class_specifier ../../trunk/gcc/cp/parser.c:18231 0x60ff40 cp_parser_type_specifier ../../trunk/gcc/cp/parser.c:13390 0x61c83d cp_parser_decl_specifier_seq ../../trunk/gcc/cp/parser.c:10731 0x628317 cp_parser_single_declaration ../../trunk/gcc/cp/parser.c:21313 0x6289c0 cp_parser_template_declaration_after_export ../../trunk/gcc/cp/parser.c:21198 0x62de39 cp_parser_declaration ../../trunk/gcc/cp/parser.c:10183 0x62c487 cp_parser_declaration_seq_opt ../../trunk/gcc/cp/parser.c:10105 0x62c762 cp_parser_translation_unit ../../trunk/gcc/cp/parser.c:3757 0x62c762 c_parse_file() ../../trunk/gcc/cp/parser.c:27557 0x72e4e4 c_common_parse_file() ../../trunk/gcc/c-family/c-opts.c:1138 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Bootstrapped on x86_64-unknown-linux-gnu. I didn't bother to run the testsuite, since the code only changes when an ICE occurs anyhow. OK for mainline? Ian gcc/: 2012-09-17 Ian Lance Taylor <i...@google.com> * diagnostic.c: Include "demangle.h" and "backtrace.h". (bt_stop): New static array. (bt_callback, bt_err_callback): New static functions. (diagnostic_action_after_output): Call backtrace_full for DK_ICE. * Makefile.in (BACKTRACE): New variable. (BACKTRACEINC, LIBBACKTRACE): New variables. (BACKTRACE_H): New variable. (LIBDEPS, LIBS): Add $(LIBBACKTRACE). (INCLUDES): Add $(BACKTRACEINC). (diagnostic.o): Depend upon $(DEMANGLE_H) and $(BACKTRACE_H). ./: 2012-09-17 Ian Lance Taylor <i...@google.com> * Makefile.def: Make all-gcc depend on all-libbacktrace. * Makefile.in: Rebuild.