Handle return value from pushdecl_top_level_and_finish in get_tinfo_decl

Geoffrey Keating gkeating@apple.com
Thu Nov 30 22:11:00 GMT 2006

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

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))
-      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);

More information about the Gcc-patches mailing list