From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27900 invoked by alias); 9 Oct 2011 18:05:24 -0000 Received: (qmail 27891 invoked by uid 22791); 9 Oct 2011 18:05:22 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 09 Oct 2011 18:05:06 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id F097F9AC8A2; Sun, 9 Oct 2011 20:05:04 +0200 (CEST) Date: Sun, 09 Oct 2011 18:34:00 -0000 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Avoid double mangling at WHOPR Message-ID: <20111009180504.GK13389@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00688.txt.bz2 Hi, whopr currently produce local_static.1234.43124 type symbols. This is because everything gets mangled at WPA time and then again at ltrans time. This simply avoids the second mangling. This save some space & makes WHOPR/non_WHOPR symbol tables comparable more directly. Bootstrapped/regtested x86_64-linux, also tested with Mozilla LTO, OK? Honza * lto.c (lto_register_var_decl_in_symtab, lto_register_function_decl_in_symtab): Do not mangle at ltrans time. * lto-lang.c (lto_set_decl_assembler_name): Likewise. Index: lto/lto.c =================================================================== --- lto/lto.c (revision 179664) +++ lto/lto.c (working copy) @@ -604,7 +604,7 @@ lto_register_var_decl_in_symtab (struct /* Variable has file scope, not local. Need to ensure static variables between different files don't clash unexpectedly. */ - if (!TREE_PUBLIC (decl) + if (!TREE_PUBLIC (decl) && !flag_ltrans && !((context = decl_function_context (decl)) && auto_var_in_fn_p (decl, context))) { @@ -646,7 +646,7 @@ lto_register_function_decl_in_symtab (st { /* Need to ensure static entities between different files don't clash unexpectedly. */ - if (!TREE_PUBLIC (decl)) + if (!TREE_PUBLIC (decl) && !flag_ltrans) { /* We must not use the DECL_ASSEMBLER_NAME macro here, as it may set the assembler name where it was previously empty. */ Index: lto/lto-lang.c =================================================================== --- lto/lto-lang.c (revision 179664) +++ lto/lto-lang.c (working copy) @@ -954,7 +954,7 @@ lto_set_decl_assembler_name (tree decl) TREE_PUBLIC, to avoid conflicts between individual files. */ tree id; - if (TREE_PUBLIC (decl)) + if (TREE_PUBLIC (decl) || flag_ltrans) id = targetm.mangle_decl_assembler_name (decl, DECL_NAME (decl)); else {