From b75ab88ba3b591f07692be10df267f0bddecc055 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 5 Oct 1998 10:12:39 +0000 Subject: [PATCH] If errorcount nonzero, don't call abort if the function is already defined. From-SVN: r22836 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b6423a5b802..df4c791a8b6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 5 10:11:28 1998 Nick Clifton + + * dwarf2out.c (gen_subprogram_die): If errorcount nonzero, don't + call abort if the function is already defined. + Mon Oct 5 10:02:36 1998 Jeffrey A Law (law@cygnus.com) * combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 21367bb26c0..3314b9fe204 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -8179,7 +8179,17 @@ gen_subprogram_die (decl, context_die) = lookup_filename (DECL_SOURCE_FILE (decl)); if (get_AT_flag (old_die, DW_AT_declaration) != 1) - abort (); + { + /* ??? This can happen if there is a bug in the program, for + instance, if it has duplicate function definitions. Ideally, + we should detect this case and ignore it. For now, if we have + already reported an error, any error at all, then assume that + we got here because of a input error, not a dwarf2 bug. */ + extern int errorcount; + if (errorcount) + return; + abort (); + } /* If the definition comes from the same place as the declaration, maybe use the old DIE. We always want the DIE for this function -- 2.30.2