aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-10-10 09:56:35 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-10-10 09:56:35 +0000
commit9142736ee21629b159504a474f686cabb1612579 (patch)
treec2052fc48b778fd5952c4e962e137a8757a6e65a /gcc/lto
parent80f8cd77304aea092dafc29fe0e7f943b6588062 (diff)
downloadgcc-9142736ee21629b159504a474f686cabb1612579.zip
gcc-9142736ee21629b159504a474f686cabb1612579.tar.gz
gcc-9142736ee21629b159504a474f686cabb1612579.tar.bz2
lto-common.c (unify_scc): Do not merge anonymous NAMESPACE_DECLs.
2019-10-10 Richard Biener <rguenther@suse.de> * lto-common.c (unify_scc): Do not merge anonymous NAMESPACE_DECLs. From-SVN: r276796
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog4
-rw-r--r--gcc/lto/lto-common.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index e410232..393e1c1 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,7 @@
+2019-10-10 Richard Biener <rguenther@suse.de>
+
+ * lto-common.c (unify_scc): Do not merge anonymous NAMESPACE_DECLs.
+
2019-10-04 Joseph Myers <joseph@codesourcery.com>
* lto-lang.c (flag_isoc2x): New variable.
diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c
index 9a17933..e5c15f2 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. */
if (TREE_CODE (t) == TRANSLATION_UNIT_DECL
|| (VAR_OR_FUNCTION_DECL_P (t)
&& !(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))))