From patchwork Sun Jun 12 14:54:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 100099 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 C87A8B6FBC for ; Mon, 13 Jun 2011 00:55:01 +1000 (EST) Received: (qmail 27172 invoked by alias); 12 Jun 2011 14:54:59 -0000 Received: (qmail 27163 invoked by uid 22791); 12 Jun 2011 14:54:59 -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 14:54:44 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 213DA9AC815; Sun, 12 Jun 2011 16:54:43 +0200 (CEST) Date: Sun, 12 Jun 2011 16:54:43 +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: <20110612145443.GA7920@kam.mff.cuni.cz> References: <20110611125552.GA25068@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 > > This also pretty much destroyed C++ for ia32: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49378 > http://gcc.gnu.org/ml/gcc-regression/2011-06/msg00159.html Hi, It seems somewhat amazing that we hit kernel sensitive miscompilation here. The problem most probably is the fact that thunks and functions with thunks can become local. This is correct since thunks are represented as direct calls now, but this makes i386 to use local ABI when calling or compiling them. Does the following patch help? We may also need to look for the presence of thunk callers. Index: ipa.c =================================================================== --- ipa.c (revision 174958) +++ ipa.c (working copy) @@ -120,6 +120,7 @@ static bool cgraph_non_local_node_p_1 (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED) { 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 +133,11 @@ 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); + + if (n->thunk.thunk_p) + return false; + return !cgraph_for_node_and_aliases (n, cgraph_non_local_node_p_1, NULL, true); }