From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9007 invoked by alias); 7 Dec 2012 13:02:44 -0000 Received: (qmail 8930 invoked by uid 48); 7 Dec 2012 13:02:14 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/55466] [4.8 Regression] Revision 191466 destroyed DWARF debug info Date: Fri, 07 Dec 2012 13:02:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.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: 2012-12/txt/msg00702.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55466 --- Comment #9 from H.J. Lu 2012-12-07 13:02:12 UTC --- I am testing this patch: --- diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index 0b0cdac..295fd37 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -443,10 +443,6 @@ lto_symtab_merge_decls_1 (symtab_node first) symtab_prevail_in_asm_name_hash (prevailing); - /* Record the prevailing variable. */ - if (TREE_CODE (prevailing->symbol.decl) == VAR_DECL) - vec_safe_push (lto_global_var_decls, prevailing->symbol.decl); - /* Diagnose mismatched objects. */ for (e = prevailing->symbol.next_sharing_asm_name; e; e = e->symbol.next_sharing_asm_name) diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 376af85..c637ec8 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -3083,8 +3083,16 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) supports inlining, so we can push it here by hand. In future we need to stream this field into ltrans compilation. */ if (flag_ltrans) - FOR_EACH_DEFINED_FUNCTION (node) - node->ipa_transforms_to_apply.safe_push ((ipa_opt_pass)&pass_ipa_inline); + { + struct varpool_node *vnode; + + FOR_EACH_DEFINED_FUNCTION (node) + node->ipa_transforms_to_apply.safe_push ((ipa_opt_pass)&pass_ipa_inline); + + /* Record the global variables. */ + FOR_EACH_DEFINED_VARIABLE (vnode) + vec_safe_push (lto_global_var_decls, vnode->symbol.decl); + } timevar_pop (TV_IPA_LTO_CGRAPH_MERGE); ---