aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-09-04 01:43:58 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-09-03 21:43:58 -0400
commit1a408d072445bf265b5253db191c6a8bb8cc241d (patch)
tree099820fe5676e2fb643da24199144057dd74fa85 /gcc
parent71827aaacc89337bdbcb24e8bc6998954d5a2483 (diff)
downloadgcc-1a408d072445bf265b5253db191c6a8bb8cc241d.zip
gcc-1a408d072445bf265b5253db191c6a8bb8cc241d.tar.gz
gcc-1a408d072445bf265b5253db191c6a8bb8cc241d.tar.bz2
decl2.c (import_export_vtable): Always make artificials comdat.
* decl2.c (import_export_vtable): Always make artificials comdat. (import_export_decl): Likewise. * pt.c (mark_decl_instantiated): Likewise. From-SVN: r22230
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/NEWS2
-rw-r--r--gcc/cp/decl2.c18
-rw-r--r--gcc/cp/pt.c5
4 files changed, 21 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d497b2c..656af65 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+1998-09-03 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (import_export_vtable): Always make artificials comdat.
+ (import_export_decl): Likewise.
+ * pt.c (mark_decl_instantiated): Likewise.
+
1998-09-03 Mark Mitchell <mark@markmitchell.com>
* cp-tree.h (finish_globally_qualified_member_call_expr):
diff --git a/gcc/cp/NEWS b/gcc/cp/NEWS
index e114bd0..9cb7d5b 100644
--- a/gcc/cp/NEWS
+++ b/gcc/cp/NEWS
@@ -1,4 +1,4 @@
-*** Changes since EGCS 1.0:
+*** Changes in EGCS 1.1:
* Namespaces are fully supported. The library has not yet been converted
to use namespace std, however, and the old std-faking code is still on by
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index e24af37..c01bda2 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2555,10 +2555,9 @@ import_export_vtable (decl, type, final)
DECL_EXTERNAL (decl) = ! CLASSTYPE_VTABLE_NEEDS_WRITING (type);
DECL_INTERFACE_KNOWN (decl) = 1;
- /* For WIN32 we also want to put explicit instantiations in
- linkonce sections. */
- if (CLASSTYPE_EXPLICIT_INSTANTIATION (type))
- maybe_make_one_only (decl);
+ /* Always make vtables weak. */
+ if (flag_weak)
+ comdat_linkage (decl);
}
else
{
@@ -2873,6 +2872,10 @@ import_export_decl (decl)
DECL_NOT_REALLY_EXTERN (decl)
= ! (CLASSTYPE_INTERFACE_ONLY (ctype)
|| (DECL_THIS_INLINE (decl) && ! flag_implement_inlines));
+
+ /* Always make artificials weak. */
+ if (DECL_ARTIFICIAL (decl) && flag_weak)
+ comdat_linkage (decl);
}
else
comdat_linkage (decl);
@@ -2894,10 +2897,9 @@ import_export_decl (decl)
= ! (CLASSTYPE_INTERFACE_ONLY (ctype)
|| (DECL_THIS_INLINE (decl) && ! flag_implement_inlines));
- /* For WIN32 we also want to put explicit instantiations in
- linkonce sections. */
- if (CLASSTYPE_EXPLICIT_INSTANTIATION (ctype))
- maybe_make_one_only (decl);
+ /* Always make artificials weak. */
+ if (flag_weak)
+ comdat_linkage (decl);
}
else if (TYPE_BUILT_IN (ctype) && ctype == TYPE_MAIN_VARIANT (ctype))
DECL_NOT_REALLY_EXTERN (decl) = 0;
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index ab9332a..d2251e8 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7202,9 +7202,12 @@ mark_decl_instantiated (result, extern_p)
DECL_INTERFACE_KNOWN (result) = 1;
DECL_NOT_REALLY_EXTERN (result) = 1;
+ /* Always make artificials weak. */
+ if (DECL_ARTIFICIAL (result) && flag_weak)
+ comdat_linkage (result);
/* For WIN32 we also want to put explicit instantiations in
linkonce sections. */
- if (TREE_PUBLIC (result))
+ else if (TREE_PUBLIC (result))
maybe_make_one_only (result);
}
else if (TREE_CODE (result) == FUNCTION_DECL)