public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Clear visibility of TYPE_DECL
@ 2016-02-26 10:50 Jan Hubicka
  2016-02-26 11:12 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Hubicka @ 2016-02-26 10:50 UTC (permalink / raw)
  To: gcc-patches, rguenther

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?

	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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Clear visibility of TYPE_DECL
  2016-02-26 10:50 Clear visibility of TYPE_DECL Jan Hubicka
@ 2016-02-26 11:12 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2016-02-26 11:12 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc-patches

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-26 11:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-26 10:50 Clear visibility of TYPE_DECL Jan Hubicka
2016-02-26 11:12 ` Richard Biener

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).