From patchwork Mon Apr 9 08:53:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 151424 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 59086B7037 for ; Mon, 9 Apr 2012 18:55:02 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1334566504; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:User-Agent:MIME-Version:Message-Id: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=CBJSJmb jMZzvlzVJRz3/pZJwzb4=; b=aI8kwda8FSEgPWhB+KysO6EStPK/dznPu2KNmx5 BDE6gtT5ch258vC+a6HWzel3HEumdhXb5Wr8Q+qqYNLXEzLxQ1io8fWaoIyph120 sKI2+7wZuuEsjBjz2YWtQVJQQtC6sp9t0ElTcLG4Q5/ae/80QklcUGV/ERkMydvv z/rQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:To:Subject:Date:User-Agent:MIME-Version:Message-Id:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=e96PE54WU/mxjxWOV7wVVYcakzVJXLbzvIeq2WMPRO5r6/AB6B5p2BJlLJZjEK Vrb19Y54KzwYB3zObyhCkkDAx3+G+kb8OC48KH8C8BkVE+g/xgj4oHut20JdmJ31 Cn//PTuwcey+UJaJohagAUWdyW9dVA0tstV8AIw3T2+dA=; Received: (qmail 14235 invoked by alias); 9 Apr 2012 08:54:59 -0000 Received: (qmail 14226 invoked by uid 22791); 9 Apr 2012 08:54:58 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Apr 2012 08:54:45 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 12495290023 for ; Mon, 9 Apr 2012 10:54:49 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id omRLKwLU1a-b for ; Mon, 9 Apr 2012 10:54:49 +0200 (CEST) Received: from [192.168.1.2] (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id D0A61290022 for ; Mon, 9 Apr 2012 10:54:48 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [SPARC] Fix PR target/52717 Date: Mon, 9 Apr 2012 10:53:47 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201204091053.47330.ebotcazou@adacore.com> 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 is the LTO issue with -fpic/-fpie on SPARC/Linux. When the special GOT helper function is generated, the compiler invokes: make_decl_one_only (decl, DECL_ASSEMBLER_NAME (decl)); on it, which sets the TREE_PUBLIC flag as expected. The problem is that, in LTO mode, DECL_ASSEMBLER_NAME (decl) depends on TREE_PUBLIC being set or not. Tested on SPARC/Linux, applied to all active branches. 2012-04-09 Eric Botcazou PR target/52717 * config/sparc/sparc.c (sparc_file_end): Set TREE_PUBLIC explicitly on the DECL generated for the special GOT helper. Index: config/sparc/sparc.c =================================================================== --- config/sparc/sparc.c (revision 186176) +++ config/sparc/sparc.c (working copy) @@ -10800,6 +10800,7 @@ sparc_file_end (void) NULL_TREE)); DECL_RESULT (decl) = build_decl (BUILTINS_LOCATION, RESULT_DECL, NULL_TREE, void_type_node); + TREE_PUBLIC (decl) = 1; TREE_STATIC (decl) = 1; make_decl_one_only (decl, DECL_ASSEMBLER_NAME (decl)); DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;