[[committed] ] d: Use d_comdat_linkage on generated internal decl.

Message ID 20200331140422.27101-1-ibuclaw@gdcproject.org
State New
Headers show
Series
  • [[committed] ] d: Use d_comdat_linkage on generated internal decl.
Related show

Commit Message

Iain Buclaw via Gcc-patches March 31, 2020, 2:04 p.m.
Hi,

This patch adds weak linkage to internal TypeInfo data on top of the
existing DECL_COMDAT, which helps in the unlikely event that two of the
same TypeInfo data ends up in multiple places.

Tested on x86_64-linux-gnu and committed to mainline.

Regards
Iain
---

gcc/d/ChangeLog:

	* typeinfo.cc (TypeInfoVisitor::internal_reference): Call
	d_comdat_linkage on generated decl.

---
 gcc/d/typeinfo.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.20.1

Patch

diff --git a/gcc/d/typeinfo.cc b/gcc/d/typeinfo.cc
index 07011deaf6f..90a44944f4c 100644
--- a/gcc/d/typeinfo.cc
+++ b/gcc/d/typeinfo.cc
@@ -358,7 +358,7 @@  class TypeInfoVisitor : public Visitor
     DECL_EXTERNAL (decl) = 0;
     TREE_PUBLIC (decl) = 1;
     DECL_VISIBILITY (decl) = VISIBILITY_INTERNAL;
-    DECL_COMDAT (decl) = 1;
+    d_comdat_linkage (decl);
     d_pushdecl (decl);
 
     return decl;