aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-06-23 19:46:26 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2003-06-23 17:46:26 +0000
commitbb4f6e6bb7e8116f062df0acf5fe6e682f787049 (patch)
tree3fdd057575368667bd9bdbd3ecc5786dd2f79ee3
parent2b491e3a3b2126c32b3d77932a2d1a09592b088f (diff)
downloadgcc-bb4f6e6bb7e8116f062df0acf5fe6e682f787049.zip
gcc-bb4f6e6bb7e8116f062df0acf5fe6e682f787049.tar.gz
gcc-bb4f6e6bb7e8116f062df0acf5fe6e682f787049.tar.bz2
decl.c (register_dtor_fn): Mark cleanup as used.
* decl.c (register_dtor_fn): Mark cleanup as used. * decl2.c (mark_vtable_entries): Skip nops. * rtti.c (get_tinfo_ptr): Mark tinfo as used. (build_dynamic_cast_1): Likewise. (tinfo_base_init): Likewise. (emit_tinfo_decl): Likewise. From-SVN: r68377
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/decl.c1
-rw-r--r--gcc/cp/decl2.c4
-rw-r--r--gcc/cp/rtti.c15
4 files changed, 25 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 77d85a6..641b4a2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+Mon Jun 23 19:41:27 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * decl.c (register_dtor_fn): Mark cleanup as used.
+ * decl2.c (mark_vtable_entries): Skip nops.
+ * rtti.c (get_tinfo_ptr): Mark tinfo as used.
+ (build_dynamic_cast_1): Likewise.
+ (tinfo_base_init): Likewise.
+ (emit_tinfo_decl): Likewise.
+
2003-06-23 Jakub Jelinek <jakub@redhat.com>
* mangle.c (hash_type): val is the TREE_LIST itself, not a pointer
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index f539842..9e3a9ce 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8486,6 +8486,7 @@ register_dtor_fn (tree decl)
/* Call atexit with the cleanup function. */
cxx_mark_addressable (cleanup);
+ mark_used (cleanup);
cleanup = build_unary_op (ADDR_EXPR, cleanup, 0);
if (flag_use_cxa_atexit)
{
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 3fa4d74..44ea6a3 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1393,7 +1393,9 @@ mark_vtable_entries (tree decl)
{
tree fnaddr = TREE_VALUE (entries);
tree fn;
-
+
+ STRIP_NOPS (fnaddr);
+
if (TREE_CODE (fnaddr) != ADDR_EXPR
&& TREE_CODE (fnaddr) != FDESC_EXPR)
/* This entry is an offset: a virtual base class offset, a
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 1a29c1c..74b7c90 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -387,8 +387,11 @@ get_tinfo_decl (tree type)
static tree
get_tinfo_ptr (tree type)
{
+ tree decl = get_tinfo_decl (type);
+
+ mark_used (decl);
return build_nop (type_info_ptr_type,
- build_address (get_tinfo_decl (type)));
+ build_address (decl));
}
/* Return the type_info object for TYPE. */
@@ -612,8 +615,12 @@ build_dynamic_cast_1 (tree type, tree expr)
target_type = TYPE_MAIN_VARIANT (TREE_TYPE (type));
static_type = TYPE_MAIN_VARIANT (TREE_TYPE (exprtype));
- td2 = build_unary_op (ADDR_EXPR, get_tinfo_decl (target_type), 0);
- td3 = build_unary_op (ADDR_EXPR, get_tinfo_decl (static_type), 0);
+ td2 = get_tinfo_decl (target_type);
+ mark_used (td2);
+ td2 = build_unary_op (ADDR_EXPR, td2, 0);
+ td3 = get_tinfo_decl (static_type);
+ mark_used (td3);
+ td3 = build_unary_op (ADDR_EXPR, td3, 0);
/* Determine how T and V are related. */
boff = get_dynamic_cast_base_type (static_type, target_type);
@@ -769,6 +776,7 @@ tinfo_base_init (tree desc, tree target)
SET_DECL_ASSEMBLER_NAME (name_decl,
mangle_typeinfo_string_for_type (target));
DECL_INITIAL (name_decl) = name_string;
+ mark_used (name_decl);
pushdecl_top_level_and_finish (name_decl, name_string);
}
@@ -1461,6 +1469,7 @@ emit_tinfo_decl (tree decl)
DECL_COMDAT (decl) = 0;
DECL_INITIAL (decl) = var_init;
+ mark_used (decl);
cp_finish_decl (decl, var_init, NULL_TREE, 0);
/* cp_finish_decl will have dealt with linkage. */