From patchwork Tue Nov 29 16:22:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Edelsohn X-Patchwork-Id: 128300 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 475A31007D8 for ; Wed, 30 Nov 2011 03:22:40 +1100 (EST) Received: (qmail 31402 invoked by alias); 29 Nov 2011 16:22:35 -0000 Received: (qmail 31391 invoked by uid 22791); 29 Nov 2011 16:22:33 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-vw0-f47.google.com (HELO mail-vw0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Nov 2011 16:22:17 +0000 Received: by vbbfc21 with SMTP id fc21so4814270vbb.20 for ; Tue, 29 Nov 2011 08:22:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.11.72 with SMTP id o8mr3105378obb.36.1322583736906; Tue, 29 Nov 2011 08:22:16 -0800 (PST) Received: by 10.182.5.200 with HTTP; Tue, 29 Nov 2011 08:22:15 -0800 (PST) In-Reply-To: <4ED4212F.4050502@redhat.com> References: <4EC6CCF4.9050405@redhat.com> <4ECAF310.80705@redhat.com> <4ECB9E61.5020202@redhat.com> <4ECCF982.10409@redhat.com> <20111123135731.GY27242@tyan-ft48-01.lab.bos.redhat.com> <4ED4212F.4050502@redhat.com> Date: Tue, 29 Nov 2011 11:22:15 -0500 Message-ID: Subject: Re: PR other/51174: handle architectures with no DECL_COMDAT_GROUP From: David Edelsohn To: Richard Henderson Cc: Jakub Jelinek , Aldy Hernandez , gcc-patches 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 On Mon, Nov 28, 2011 at 7:02 PM, Richard Henderson wrote: > On 11/28/2011 03:54 PM, David Edelsohn wrote: >> On Wed, Nov 23, 2011 at 8:57 AM, Jakub Jelinek wrote: >>> On Wed, Nov 23, 2011 at 07:47:46AM -0600, Aldy Hernandez wrote: >>>>>> @@ -4198,7 +4198,7 @@ ipa_tm_create_version_alias (struct cgra >>>>>>   TREE_SYMBOL_REFERENCED (tm_name) = 1; >>>>>> >>>>>>   /* Perform the same remapping to the comdat group.  */ >>>>>> -  if (DECL_COMDAT (new_decl)) >>>>>> +  if (HAVE_COMDAT_GROUP&&  DECL_COMDAT (new_decl)) >>>>>>     DECL_COMDAT_GROUP (new_decl) = tm_mangle (DECL_COMDAT_GROUP (old_decl)); >>>>>> >>>>>>   new_node = cgraph_same_body_alias (NULL, new_decl, info->new_decl); >>> >>> Wouldn't it be better to test if (DECL_ONE_ONLY (new_decl)) >>> instead?  That is actually test for non-NULL DECL_COMDAT_GROUP >>> and is what e.g. cp/ uses as guards on tweaking DECL_COMDAT_GROUP. >>> >>> BTW, the formatting is wrong above, no space before && and two spaces after >>> it. >> >> That will work as well. >> >> Which solution should be committed? > > Please use the DECL_ONE_ONLY test. A patch using DECL_ONE_ONLY works for me as well. Can someone approve that version of the patch? * trans-mem.c (ipa_tm_create_version_alias): Mangle new_decl if DECL_ONE_ONLY. (ipa_tm_create_version): Same. Thanks, David Index: trans-mem.c =================================================================== --- trans-mem.c (revision 181793) +++ trans-mem.c (working copy) @@ -4213,7 +4213,7 @@ ipa_tm_create_version_alias (struct cgra TREE_SYMBOL_REFERENCED (tm_name) = 1; /* Perform the same remapping to the comdat group. */ - if (DECL_COMDAT (new_decl)) + if (DECL_ONE_ONLY (new_decl)) DECL_COMDAT_GROUP (new_decl) = tm_mangle (DECL_COMDAT_GROUP (old_decl)); new_node = cgraph_same_body_alias (NULL, new_decl, info->new_decl); @@ -4248,7 +4248,7 @@ ipa_tm_create_version (struct cgraph_nod TREE_SYMBOL_REFERENCED (tm_name) = 1; /* Perform the same remapping to the comdat group. */ - if (DECL_COMDAT (new_decl)) + if (DECL_ONE_ONLY (new_decl)) DECL_COMDAT_GROUP (new_decl) = tm_mangle (DECL_COMDAT_GROUP (old_decl)); new_node = cgraph_copy_node_for_versioning (old_node, new_decl, NULL, NULL);