http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58585

--- Comment #10 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Seems we got stuck on solving the virtual vtable representation issues.  Here
are some of my experiments.

I think we have two problems, the first one is manifested by this testcase.
Here record_targets_from_binfo is not able to work out proper vtable
associated with a call.  Martin pointed out to me that C++ FE uses BINFO_FLAG_2
to mark binfos for which it generated vtable.  This seems to help this testcase
(w/o LTO, since we do not stream it)

Index: ipa-devirt.c
===================================================================
--- ipa-devirt.c        (revision 205941)
+++ ipa-devirt.c        (working copy)
@@ -679,7 +679,7 @@
                                /* In the case of single inheritance,
                                   the virtual table is shared with
                                   the outer type.  */
-                               BINFO_VTABLE (base_binfo) ? base_binfo :
type_binfo,
+                               BINFO_FLAG_2 (base_binfo) && BINFO_VTABLE
(base_binfo) ? base_binfo : type_binfo,
                                otr_token, outer_type, offset, inserted,
                                matched_vtables, anonymous);
 }

I am not happy that I need BINFO_VTABLE flag, too. Apparently sometimes C++ FE
marks even binfos that do not have vtable with them.
Jason, does this seem at all some sense?

Reply via email to