This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [lto][patch] Clear binfo


2008/11/19 Rafael Espindola <espindola@google.com>:
> The attached patch fixes the contained testcase. It also introduces a
> regression:

Attached now.

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index b30ad81..2090e87 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -53,8 +53,11 @@ static enum classify_record cp_classify_record (tree type);
 #define LANG_HOOKS_DECL_PRINTABLE_NAME	cxx_printable_name
 #undef LANG_HOOKS_DWARF_NAME
 #define LANG_HOOKS_DWARF_NAME cxx_dwarf_name
-#undef LANG_HOOKS_FOLD_OBJ_TYPE_REF
-#define LANG_HOOKS_FOLD_OBJ_TYPE_REF cp_fold_obj_type_ref
+
+/* FIXME lto: disabled so we can clear TYPE_BINFO */
+/* #undef LANG_HOOKS_FOLD_OBJ_TYPE_REF */
+/* #define LANG_HOOKS_FOLD_OBJ_TYPE_REF cp_fold_obj_type_ref */
+
 #undef LANG_HOOKS_INIT_TS
 #define LANG_HOOKS_INIT_TS cp_init_ts
 
diff --git a/gcc/testsuite/g++.dg/lto/20081119_0.C b/gcc/testsuite/g++.dg/lto/20081119_0.C
new file mode 100644
index 0000000..c77a430
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081119_0.C
@@ -0,0 +1,24 @@
+class foo {
+ public:
+ foo () {}
+ virtual ~foo() {}
+ virtual void m() {}
+};
+
+template<typename t>
+class bar : public foo {
+ public:
+ bar () {}
+};
+
+void
+f1 (bar<int> *p)
+{
+ p->m();
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lto/20081119_1.C b/gcc/testsuite/g++.dg/lto/20081119_1.C
new file mode 100644
index 0000000..71a2a5c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/20081119_1.C
@@ -0,0 +1,18 @@
+class foo {
+ public:
+ foo () {}
+ virtual ~foo() {}
+ virtual void m() {}
+};
+
+template<typename t>
+class bar : public foo {
+ public:
+ bar () {}
+};
+
+void
+f2 (bar<int> *p)
+{
+ p->m();
+}
diff --git a/gcc/tree.c b/gcc/tree.c
index e8a8904..534429e 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3933,6 +3933,7 @@ reset_type_lang_specific (void **slot, void *unused ATTRIBUTE_UNUSED)
 	TYPE_FIELDS (type) = NULL_TREE;
 
       TYPE_METHODS (type)  = NULL_TREE;
+      TYPE_BINFO (type)  = NULL_TREE;
     }
 
   if (TREE_CODE (type) == INTEGER_TYPE)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]