[LTO] Do not merge anonymous NAMESPACE_DECLs
diff mbox series

Message ID nycvar.YFH.7.76.1910091538240.5566@zhemvz.fhfr.qr
State New
Headers show
  • [LTO] Do not merge anonymous NAMESPACE_DECLs
Related show

Commit Message

Richard Biener Oct. 9, 2019, 1:40 p.m. UTC
The following does $subject which likely fixes some debuginfo issues
with anonymous namespaces (but likely artificial and not too
noticable?!  we'd get bogus contexts for DIEs)

Bootstrapped and tested on x86_64-unknown-linux-gnu.

I'm doin a LTO bootstrap right now (but IIRC it failed a few days ago)


2019-10-09  Richard Biener  <rguenther@suse.de>

	* lto-common.c (unify_scc): Do not merge anonymous NAMESPACE_DECLs.

diff mbox series

diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c
index 9a17933d094..e5c15f2b844 100644
--- a/gcc/lto/lto-common.c
+++ b/gcc/lto/lto-common.c
@@ -1646,11 +1646,13 @@  unify_scc (class data_in *data_in, unsigned from,
       tree t = streamer_tree_cache_get_tree (cache, from + i);
       scc->entries[i] = t;
       /* Do not merge SCCs with local entities inside them.  Also do
-	 not merge TRANSLATION_UNIT_DECLs and anonymous namespace types.  */
+	 not merge TRANSLATION_UNIT_DECLs and anonymous namespaces
+	 and types therein types.  */
 	      && !(TREE_PUBLIC (t) || DECL_EXTERNAL (t)))
 	  || TREE_CODE (t) == LABEL_DECL
+	  || (TREE_CODE (t) == NAMESPACE_DECL && !DECL_NAME (t))
 	  || (TYPE_P (t)
 	      && type_with_linkage_p (TYPE_MAIN_VARIANT (t))
 	      && type_in_anonymous_namespace_p (TYPE_MAIN_VARIANT (t))))