From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7496 invoked by alias); 9 Jan 2013 15:17:12 -0000 Received: (qmail 6960 invoked by uid 48); 9 Jan 2013 15:16:42 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/45375] [meta-bug] Issues with building Mozilla with LTO Date: Wed, 09 Jan 2013 15:17: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: meta-bug X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: 2013-01/txt/msg00818.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45375 --- Comment #165 from Jan Hubicka 2013-01-09 15:16:26 UTC --- OK, I tracked down the undefined reference to error: /tmp/cc0oq4BG.ltrans1.ltrans.o: requires dynamic R_X86_64_PC32 reloc against '_ZN12SkAnnotationC1ER23SkFlattenableReadBuffer' which may overflow at runtime; recompile with -fPIC it is caused by bug in Mozilla - it includes file defininig virtual function that use '_ZN12SkAnnotationC1ER23SkFlattenableReadBuffer' (in SkPaint) but it never links with implementation. Normally the function is optimized out. It is not due to fact that we never optimize out virtual functions prior inlining for devirtualization and in WPA path we forget to remove these when done. Fixed by the following patch Index: ipa-inline.c =================================================================== --- ipa-inline.c (revision 194916) +++ ipa-inline.c (working copy) @@ -1793,7 +1793,7 @@ } inline_small_functions (); - symtab_remove_unreachable_nodes (true, dump_file); + symtab_remove_unreachable_nodes (false, dump_file); free (order); /* Inline functions with a property that after inlining into all callers the Index: lto/lto.c =================================================================== --- lto/lto.c (revision 194916) +++ lto/lto.c (working copy) @@ -3215,6 +3215,7 @@ cgraph_state = CGRAPH_STATE_IPA_SSA; execute_ipa_pass_list (all_regular_ipa_passes); + symtab_remove_unreachable_nodes (false, dump_file); if (cgraph_dump_file) { Index: cgraphclones.c =================================================================== --- cgraphclones.c (revision 194916) +++ cgraphclones.c (working copy) @@ -184,6 +184,7 @@ new_node->symbol.decl = decl; symtab_register_node ((symtab_node)new_node); new_node->origin = n->origin; + new_node->symbol.lto_file_data = n->symbol.lto_file_data; if (new_node->origin) { new_node->next_nested = new_node->origin->nested;