From patchwork Sun Jun 12 16:40:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 100109 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D468FB70A1 for ; Mon, 13 Jun 2011 02:41:16 +1000 (EST) Received: (qmail 1414 invoked by alias); 12 Jun 2011 16:41:14 -0000 Received: (qmail 1399 invoked by uid 22791); 12 Jun 2011 16:41:14 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 12 Jun 2011 16:41:00 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id B2B379AC80B; Sun, 12 Jun 2011 18:40:59 +0200 (CEST) Date: Sun, 12 Jun 2011 18:40:59 +0200 From: Jan Hubicka To: "H.J. Lu" Cc: Jan Hubicka , gcc-patches@gcc.gnu.org Subject: Re: Cgraph alias reorg 15/14 (New infrastructure for same body aliases) Message-ID: <20110612164059.GE19441@kam.mff.cuni.cz> References: <20110611125552.GA25068@kam.mff.cuni.cz> <20110612145443.GA7920@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, this is the fix (or rather a workaround) i comitted. Thanks! Index: ChangeLog =================================================================== --- ChangeLog (revision 174968) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2011-06-11 Jan Hubicka + + PR middle-end/49378 + * ipa.c (cgraph_non_local_node_p_1, cgraph_local_node_p): Rule out + aliases and thunks. + 2011-06-12 Ira Rosen * tree-vect-data-refs.c (vect_peeling_hash_get_most_frequent): Index: ipa.c =================================================================== --- ipa.c (revision 174958) +++ ipa.c (working copy) @@ -119,7 +119,9 @@ process_references (struct ipa_ref_list static bool cgraph_non_local_node_p_1 (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED) { + /* FIXME: Aliases can be local, but i386 gets thunks wrong then. */ return !(cgraph_only_called_directly_or_aliased_p (node) + && !ipa_ref_has_aliases_p (&node->ref_list) && node->analyzed && !DECL_EXTERNAL (node->decl) && !node->local.externally_visible @@ -132,7 +134,13 @@ cgraph_non_local_node_p_1 (struct cgraph static bool cgraph_local_node_p (struct cgraph_node *node) { - return !cgraph_for_node_and_aliases (cgraph_function_or_thunk_node (node, NULL), + struct cgraph_node *n = cgraph_function_or_thunk_node (node, NULL); + + /* FIXME: thunks can be considered local, but we need prevent i386 + from attempting to change calling convention of them. */ + if (n->thunk.thunk_p) + return false; + return !cgraph_for_node_and_aliases (n, cgraph_non_local_node_p_1, NULL, true); }