public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: Clear visibility of TYPE_DECL
Date: Fri, 26 Feb 2016 11:12:00 -0000	[thread overview]
Message-ID: <alpine.LSU.2.11.1602261211400.31547@t29.fhfr.qr> (raw)
In-Reply-To: <20160226105025.GB94603@kam.mff.cuni.cz>

On Fri, 26 Feb 2016, Jan Hubicka wrote:

> Hi,
> while looking into PR69589 I noticed that types are not merged when pragma
> visibility does not match. This is because C++ FE stores visibility into TYPE_DECL
> that is used by FE only.  This patch clears the flag in free_lang_data.
> 
> Bootstrapped/regtested x86_64-linux and tested it makes no difference for
> Firefox LTO binary, OK?

Ok.

Richard.

> 	PR lto/69589
> 	* tree.c (free_lang_data_in_decl): Clear visibility of TYPE_DECL.
> Index: tree.c
> ===================================================================
> --- tree.c	(revision 233707)
> +++ tree.c	(working copy)
> @@ -5472,8 +5473,13 @@ free_lang_data_in_decl (tree decl)
>  	  || (decl_function_context (decl) && !TREE_STATIC (decl)))
>  	DECL_INITIAL (decl) = NULL_TREE;
>      }
> -  else if (TREE_CODE (decl) == TYPE_DECL
> -	   || TREE_CODE (decl) == FIELD_DECL)
> +  else if (TREE_CODE (decl) == TYPE_DECL)
> +    {
> +      DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
> +      DECL_VISIBILITY_SPECIFIED (decl) = 0;
> +      DECL_INITIAL (decl) = NULL_TREE;
> +    }
> +  else if (TREE_CODE (decl) == FIELD_DECL)
>      DECL_INITIAL (decl) = NULL_TREE;
>    else if (TREE_CODE (decl) == TRANSLATION_UNIT_DECL
>             && DECL_INITIAL (decl)

      reply	other threads:[~2016-02-26 11:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 10:50 Jan Hubicka
2016-02-26 11:12 ` Richard Biener [this message]

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.LSU.2.11.1602261211400.31547@t29.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).