From patchwork Sun Jan 19 02:12:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 312361 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 0991E2C00A3 for ; Sun, 19 Jan 2014 13:12:59 +1100 (EST) 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=wT5yUz3QGT29f98jNGiotM0YxQkQJbKSbXPplS3xweJ5788RvgyMW kERPeV8uB+GcJ64Q5ETjsgnu4eMgO+KYDnIoLn+ga+WjDKaZGAOOCnUsoEdP9rHV zhYB6xgZY73eVrptykNGLvZWrb3VtkxYa8bnbbr9NgfOotht3eGAGU= 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=yJJeDOPx5ND7k+T/MugaM8VJh8o=; b=kXZOtDqKlr4W5wAMxgDm xWEnrZ9tbl9F7uZCOys9xhDWVzd6amWrPn1qcaZ8B09nNEqnzevmM/7XDOv0x0DL ZeWX0ZurrAB1rnIVGsQMMpwWNkg5gJMd5wD2Gqr8/Ev9IxTu3BeGbU3doXZIiS4P lOg6lDL1you/amQgFjqM954= Received: (qmail 20908 invoked by alias); 19 Jan 2014 02:12:47 -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 20897 invoked by uid 89); 19 Jan 2014 02:12:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 19 Jan 2014 02:12:43 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 8D6C5542201; Sun, 19 Jan 2014 03:12:39 +0100 (CET) Date: Sun, 19 Jan 2014 03:12:39 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix compute_reloc_for_constant Message-ID: <20140119021239.GA22057@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hi, while comparing LTO and non-LTO builds I noticed that with LTO we produce a lot more vtables in datal.rel.ro rather than data.rel.ro.local This is because of partitioning promoting more symbols global. For RTL we make section decisions based on SYMBOL_REF_LOCAL_FLAG that is set based on decl_binds_local_p. For variables we use TREE_PUBLIC check that is overly conservative. Bootstrapped/regtested x86_64-linux, OK? * varasm.c (compute_reloc_for_constant): Use targetm.binds_local_p instead of TREE_PUBLIC to determine if reference will be local within given DSO or not. Index: varasm.c =================================================================== --- varasm.c (revision 206684) +++ varasm.c (working copy) @@ -4060,7 +4060,7 @@ break; } - if (TREE_PUBLIC (tem)) + if (!targetm.binds_local_p (tem)) reloc |= 2; else reloc |= 1;