From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25920 invoked by alias); 10 Sep 2004 07:49:26 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 25900 invoked by uid 48); 10 Sep 2004 07:49:23 -0000 Date: Fri, 10 Sep 2004 07:49:00 -0000 Message-ID: <20040910074923.25899.qmail@sourceware.org> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040910045519.17389.aj@gcc.gnu.org> References: <20040910045519.17389.aj@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug debug/17389] [4.0 Regression] ICE in dwarf2out_finish, at dwarf2out.c:13566 X-Bugzilla-Reason: CC X-SW-Source: 2004-09/txt/msg00921.txt.bz2 List-Id: ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-10 07:49 ------- I don't know if this is wrong or not but I have been dinking so: @@ -13632,25 +13544,28 @@ dwarf2out_finish (const char *filename) else if (errorcount > 0 || sorrycount > 0) /* It's OK to be confused by errors in the input. */ add_child_die (comp_unit_die, die); - else if (node->created_for - && ((DECL_P (node->created_for) - && (context = DECL_CONTEXT (node->created_for))) - || (TYPE_P (node->created_for) - && (context = TYPE_CONTEXT (node->created_for)))) - && TREE_CODE (context) == FUNCTION_DECL) + else { /* In certain situations, the lexical block containing a nested function can be optimized away, which results in the nested function die being orphaned. Likewise with the return type of that nested function. Force this to be a child of the containing function. */ + tree context = NULL_TREE; + + gcc_assert (node->created_for); + + if (DECL_P (node->created_for)) + context = DECL_CONTEXT (node->created_for); + else if (TYPE_P (node->created_for)) + context = TYPE_CONTEXT (node->created_for); + + gcc_assert (context && TREE_CODE (context) == FUNCTION_DECL); <-- this + origin = lookup_decl_die (context); - if (! origin) - abort (); + gcc_assert (origin); add_child_die (origin, die); } - else - abort (); -- What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |critical Keywords| |ice-on-valid-code Summary|ICE in dwarf2out_finish, at |[4.0 Regression] ICE in |dwarf2out.c:13566 |dwarf2out_finish, at | |dwarf2out.c:13566 Target Milestone|--- |4.0.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17389