From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14904 invoked by alias); 22 Dec 2011 12:01:03 -0000 Received: (qmail 14877 invoked by uid 22791); 22 Dec 2011 12:00:59 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_BX,TW_IB X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Dec 2011 12:00:45 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/51650] [4.7 regression] LTO ICE in dwarf2out_finish, at dwarf2out.c:22501 while building libxul Date: Thu, 22 Dec 2011 12:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Keywords: ice-on-valid-code, lto X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-12/txt/msg02448.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51650 --- Comment #3 from Richard Guenther 2011-12-22 12:00:27 UTC --- In non-LTO mode we create the DIE for 'C' (which we do not create at all with -flto) via #3 0x0000000000d54c57 in rest_of_type_compilation (type=0x7ffff5b8f3f0, toplev=1) at /space/rguenther/src/svn/trunk/gcc/passes.c:238 238 debug_hooks->type_decl (TYPE_STUB_DECL (type), !toplev); we do not do something equivalent for LTO (but LTO expects to have those DIEs created lazily ...). But dwarf2out isn't prepared to deal with this situation it seems :/ I'm not sure we want to add corresponding debug_hooks calls to the LTO machinery, but if, then one place to do that would be here: Index: gcc/lto/lto.c =================================================================== --- gcc/lto/lto.c (revision 182617) +++ gcc/lto/lto.c (working copy) @@ -881,6 +881,8 @@ uniquify_nodes (struct data_in *data_in, lto_register_var_decl_in_symtab (data_in, t); else if (TREE_CODE (t) == FUNCTION_DECL && !DECL_BUILT_IN (t)) lto_register_function_decl_in_symtab (data_in, t); + else if (!flag_wpa && TREE_CODE (t) == TYPE_DECL) + debug_hooks->type_decl (t, DECL_FILE_SCOPE_P (t)); else if (TYPE_P (t) && !TYPE_CANONICAL (t)) TYPE_CANONICAL (t) = gimple_register_canonical_type (t); } but I'm not sure we won't confuse dwarf2out.c with the order we are calling type_decl () either (might be we start with T, and then the one for its context C). The above patch fixes the reduced testcase at least. Markus, can you give it a shot?