From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8912 invoked by alias); 16 Apr 2014 21:06:39 -0000 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 Received: (qmail 8879 invoked by uid 48); 16 Apr 2014 21:06:35 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/60854] [4.9/4.10 Regression] inline constructor of extern template Date: Wed, 16 Apr 2014 21:06:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka 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.9.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg01232.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60854 --- Comment #3 from Jan Hubicka --- OK, the problem is that we see the reference to alias and decide to keep the alias for future inlining. But when processing the refernce from alias to function itself, we throw it away. We need to keep the body, too ;) (the existing node->alias check actually cares about oposite case where we want to keep weakrefs) Index: ipa.c =================================================================== --- ipa.c (revision 209435) +++ ipa.c (working copy) @@ -138,7 +138,7 @@ process_references (struct ipa_ref_list symtab_node *node = ref->referred; if (node->definition && !node->in_other_partition - && ((!DECL_EXTERNAL (node->decl) || node->alias) + && ((!DECL_EXTERNAL (node->decl) || node->alias || ref->use == IPA_REF_ALIAS) || (((before_inlining_p && (cgraph_state < CGRAPH_STATE_IPA_SSA || !lookup_attribute ("always_inline",