This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH C++: get_tinfo_decl-- call typeinfo_in_lib_p with declaration type
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH C++: get_tinfo_decl-- call typeinfo_in_lib_p with declaration type
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Fri, 28 Sep 2001 22:42:08 -0400 (EDT)
Currently, typeinfo_in_lib_p is called in get_tinfo_decl with the new
decl d. The type of d is VAR_DECL. As a result, the call always
returns false and comdat linkage is used for all tinfo declarations. The
patch changes the call to use the type used to build the declaration.
This provides a true test as to whether the tinfo is in the runtime
library or not.
The patch has been bootstrap checked on hppa1.1-hp-hpux10.20 with the
HP assembler. The HP assembler generates an error when a symbol is not
defined. Thus, it is particularly sensitive to symbols not being imported.
Test results with and without the patch can be found here:
<http://gcc.gnu.org/ml/gcc-testresults/2001-09/msg00542.html>
and
<http://gcc.gnu.org/ml/gcc-testresults/2001-09/msg00507.html>,
respectively. 73 FAILS are eliminated with the patch. There are 4 new
XPASSes.
OK?
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2001-09-27 John David Anglin <dave@hiauly1.hia.nrc.ca>
* rtti.c (get_tinfo_decl): Call typeinfo_in_lib_p with the type used
to build the declaration instead of the declaration itself.
--- rtti.c.save Mon Sep 24 17:24:05 2001
+++ rtti.c Thu Sep 27 18:01:03 2001
@@ -309,7 +309,7 @@
TREE_STATIC (d) = 1;
DECL_EXTERNAL (d) = 1;
TREE_PUBLIC (d) = 1;
- if (flag_weak || !typeinfo_in_lib_p (d))
+ if (flag_weak || !typeinfo_in_lib_p (type))
comdat_linkage (d);
SET_DECL_ASSEMBLER_NAME (d, name);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0);