From patchwork Wed Mar 23 11:30:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 601192 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qVS8K35X6z9sRB for ; Wed, 23 Mar 2016 22:32:01 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=D6VvbLNB; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=bTdy2iLxskfp+gjT5TPCbqF7TWyi6RmGo7l6+w+3BunBeP1jyYYPH w6992pvlYMBnIc0sg8wTr2Nq7m+ySfcUONLvQ1m6eiWqnrZ9ISLhgcO5PVyruk1F 0bUp+Uu1ugHoNhpW7TKkb4YJuxQIri25RNzD1Ou20lt1Xi3EhuUPK4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=7QlV4SixSevJv5EWYikkVy8du1I=; b=D6VvbLNB/C2oxECDcDvQ 3rqXwHBPr8qPX9FQfRsit4EtdSJrYHlvq2i3hRrV26ercVaphw3jx7Uotws9SghB 2czScWEOFjEO3TL/53UCVC78L6ASTrL93opi2yN4LpjXJxwkLI+CKsz9FDdEYmGq YKmFrNLdp5jd8QDFbB5Wx5M= Received: (qmail 35364 invoked by alias); 23 Mar 2016 11:31:48 -0000 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 Received: (qmail 35345 invoked by uid 89); 23 Mar 2016 11:31:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Respect, Follow, 2016-03-23, 20160323 X-HELO: mail-wm0-f54.google.com Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 23 Mar 2016 11:31:45 +0000 Received: by mail-wm0-f54.google.com with SMTP id l68so19654344wml.1 for ; Wed, 23 Mar 2016 04:31:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=yloLLqfFet7pK/tocQlyMryO52S7sZOPXSn5weOZwcs=; b=k+NsuJq0KR+L9Fy9nAOfPWiEA5Oi6I0Xgj5Fv8TRBPUszMp+Fa08gSQ2M7gcmLrrnh efk6riDH1OYrU8O5IqvfvzCxEHZ4gANVp0IDzYbZ8T5/Pv7kRetC7uk5X4CAnzL6IS6T Pzk9NdebVqUbP0qH5s7mBTrLsxHx+HVSBXAdRB9CtMwRIA8sKDe3JrOWkowCMSXJOb1q ERxgHbki0E0S8DATunpw0r7PrtmqWrUmjgbi4iO3G+MrIUgxetO3q9y0yN3aGCLETkEI 7ROiivwwoBqDzECUQ7Z3AwyCJ3Q/ud72WwAiMUcCCcwW3khgjahKjQmNbq/7WA54lQd2 HRMA== X-Gm-Message-State: AD7BkJLgSnqNF8ikOHLvbvwlty8rAN0Vru7XCTMs+0r2yo8W5woTbvMMDj+F7m6+0GC7kQ== X-Received: by 10.28.177.132 with SMTP id a126mr24394537wmf.86.1458732702718; Wed, 23 Mar 2016 04:31:42 -0700 (PDT) Received: from msticlxl57.ims.intel.com (irdmzpr01-ext.ir.intel.com. [192.198.151.36]) by smtp.gmail.com with ESMTPSA id r8sm2120623wjz.34.2016.03.23.04.31.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Mar 2016 04:31:42 -0700 (PDT) Date: Wed, 23 Mar 2016 14:30:54 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, CHKP, Solaris, PR target/69917, committed] Respect transparent alias chains of assembler names Message-ID: <20160323113054.GB309@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, This patch fixes gcc.target/i386/chkp-hidden-def.c test failure on Solaris. Failure happens because some Solaris emit code ignores transparent alias chains for assembler names. The patch was tested and approved by Rainer Orth (see [1] for more details). Applied to trunk. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69917 Thanks, Ilya --- gcc/ 2016-03-23 Ilya Enkovich PR target/69917 * config/i386/sol2.h (ASM_OUTPUT_DEF_FROM_DECLS): Follow transparent alias chain for decl assembler name. * config/sol2.c (solaris_assemble_visibility): Likewise. diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h index e56e554..368c2d2 100644 --- a/gcc/config/i386/sol2.h +++ b/gcc/config/i386/sol2.h @@ -137,8 +137,9 @@ along with GCC; see the file COPYING3. If not see /* The Solaris assembler wants a .local for non-exported aliases. */ #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \ do { \ - const char *declname = \ - IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \ + tree id = DECL_ASSEMBLER_NAME (DECL); \ + ultimate_transparent_alias_target (&id); \ + const char *declname = IDENTIFIER_POINTER (id); \ ASM_OUTPUT_DEF ((FILE), declname, \ IDENTIFIER_POINTER (TARGET)); \ if (! TREE_PUBLIC (DECL)) \ diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c index 560a07b..47b41fd 100644 --- a/gcc/config/sol2.c +++ b/gcc/config/sol2.c @@ -142,8 +142,11 @@ solaris_assemble_visibility (tree decl, int vis ATTRIBUTE_UNUSED) }; const char *name, *type; + tree id = DECL_ASSEMBLER_NAME (decl); - name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + while (IDENTIFIER_TRANSPARENT_ALIAS (id)) + id = TREE_CHAIN (id); + name = IDENTIFIER_POINTER (id); type = visibility_types[vis]; fprintf (asm_out_file, "\t.%s\t", type);