public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <rguenther@suse.de>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: Avoid double mangling at WHOPR
Date: Mon, 10 Oct 2011 09:39:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.00.1110101107060.2130@zhemvz.fhfr.qr> (raw)
In-Reply-To: <20111009180504.GK13389@kam.mff.cuni.cz>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2563 bytes --]

On Sun, 9 Oct 2011, Jan Hubicka wrote:

> 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?

Hmmm.  I'd really like to defer mangling to LTRANS at one point, as
we will know if there will be conflicts of local symbols at that point
(another point would be the partitioning code).  So this patch goes
backward ... (ideally a first step would move it to symbol resolution
time, another place where we can check for conflicts, and then only
apply it a LTRANs stage).

Richard.

> 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
>      {
> 
> 

-- 
Richard Guenther <rguenther@suse.de>
SUSE / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer

  reply	other threads:[~2011-10-10  9:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-09 18:34 Jan Hubicka
2011-10-10  9:39 ` Richard Guenther [this message]
2011-10-10 13:22   ` Jan Hubicka
2011-10-10 13:22     ` Richard Guenther
2011-10-10 13:31       ` Jan Hubicka
2011-10-10 13:45         ` Richard Guenther
2011-10-10 13:48           ` Jan Hubicka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1110101107060.2130@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).