From patchwork Tue Sep 7 14:28:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 64025 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 3B8DBB6EEA for ; Wed, 8 Sep 2010 01:24:22 +1000 (EST) Received: (qmail 6824 invoked by alias); 7 Sep 2010 14:28:35 -0000 Received: (qmail 6667 invoked by uid 22791); 7 Sep 2010 14:28:29 -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-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Sep 2010 14:28:14 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 174199AC834; Tue, 7 Sep 2010 16:28:06 +0200 (CEST) Date: Tue, 7 Sep 2010 16:28:06 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Spec DECL_VISIBILITY_SPECIFIED for whopr partitioning Message-ID: <20100907142806.GE21528@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline 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, unless DECL_VISIBILITY_SPECIFIED is set, we ignore visibilities for external symbols (to make -fvisibility work). Setting the flag in WHOPR partitioning makes locally_bound_p and friends to trust the visibility and improves PIC codegen. Boostrapped/regtested x86_64-linux, OK? Honza * lto/lto.c (promote_var): Set DECL_VISIBILITY_SPECIFIED. Index: lto/lto.c =================================================================== --- lto/lto.c (revision 163947) +++ lto/lto.c (working copy) @@ -914,6 +914,7 @@ promote_var (struct varpool_node *vnode) gcc_assert (flag_wpa); TREE_PUBLIC (vnode->decl) = 1; DECL_VISIBILITY (vnode->decl) = VISIBILITY_HIDDEN; + DECL_VISIBILITY_SPECIFIED (vnode->decl) = true; if (cgraph_dump_file) fprintf (cgraph_dump_file, "Promoting var as hidden: %s\n", varpool_node_name (vnode)); @@ -930,6 +931,7 @@ promote_fn (struct cgraph_node *node) return false; TREE_PUBLIC (node->decl) = 1; DECL_VISIBILITY (node->decl) = VISIBILITY_HIDDEN; + DECL_VISIBILITY_SPECIFIED (node->decl) = true; if (node->same_body) { struct cgraph_node *alias; @@ -938,6 +940,7 @@ promote_fn (struct cgraph_node *node) { TREE_PUBLIC (alias->decl) = 1; DECL_VISIBILITY (alias->decl) = VISIBILITY_HIDDEN; + DECL_VISIBILITY_SPECIFIED (alias->decl) = true; } } if (cgraph_dump_file)