This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Handle return value from pushdecl_top_level_and_finish in get_tinfo_decl
- From: gkeating at apple dot com (Geoffrey Keating)
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 30 Nov 2006 13:53:46 -0800 (PST)
- Subject: Handle return value from pushdecl_top_level_and_finish in get_tinfo_decl
get_tinfo_decl was ignoring the return value from
pushdecl_top_level_and_finish. I think this is usually safe, but
can't be sure, and this patch generates slightly better code for the
routine because 'd' is not live across the call, so am checking it in.
Bootstrapped & tested on powerpc-darwin8.
--
- Geoffrey Keating <geoffk@apple.com>
===File ~/patches/gcc-cp-handletinfodecldup.patch===========
2006-11-30 Geoffrey Keating <geoffk@apple.com>
* rtti.c (get_tinfo_decl): Handle return value from
pushdecl_top_level_and_finish.
Index: rtti.c
===================================================================
--- rtti.c (revision 119334)
+++ rtti.c (working copy)
@@ -384,10 +384,11 @@
define it later if we need to do so. */
DECL_EXTERNAL (d) = 1;
DECL_NOT_REALLY_EXTERN (d) = 1;
+ set_linkage_according_to_type (type, d);
+
+ d = pushdecl_top_level_and_finish (d, NULL_TREE);
if (CLASS_TYPE_P (type))
CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
- set_linkage_according_to_type (type, d);
- pushdecl_top_level_and_finish (d, NULL_TREE);
/* Add decl to the global array of tinfo decls. */
VEC_safe_push (tree, gc, unemitted_tinfo_decls, d);
============================================================