aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2002-03-15 04:54:42 -0500
committerJason Merrill <jason@gcc.gnu.org>2002-03-15 04:54:42 -0500
commit5cc90635da0173defc0f186265a68913ca5f21b0 (patch)
treede143ae82ad2ce9277bf578207642918da268945 /gcc/cp/decl2.c
parent0f9b56dcb2d761010137a566c2af9bf98d8f14eb (diff)
downloadgcc-5cc90635da0173defc0f186265a68913ca5f21b0.zip
gcc-5cc90635da0173defc0f186265a68913ca5f21b0.tar.gz
gcc-5cc90635da0173defc0f186265a68913ca5f21b0.tar.bz2
toplev.c (wrapup_global_declarations): Clarify variable handling.
* toplev.c (wrapup_global_declarations): Clarify variable handling. -fkeep-static-consts doesn't apply to comdats. cp/ * decl.c (make_rtl_for_nonlocal_decl): Also defer COMDAT variables. * decl2.c (maybe_make_one_only): Also mark the decl as needed. From-SVN: r50802
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 8841dec..5246a7f 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2210,8 +2210,12 @@ maybe_make_one_only (decl)
make_decl_one_only (decl);
- if (TREE_CODE (decl) == VAR_DECL && DECL_LANG_SPECIFIC (decl))
- DECL_COMDAT (decl) = 1;
+ if (TREE_CODE (decl) == VAR_DECL)
+ {
+ DECL_COMDAT (decl) = 1;
+ /* Mark it needed so we don't forget to emit it. */
+ TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) = 1;
+ }
}
/* Returns the virtual function with which the vtable for TYPE is