Hi, this testcase triggers overactive check in record_target_from_binfo. It is confused by fact that we may have hard time not only looking for a vtable of virtual base but also of base of this virtual base that no longer has virtual flag on it.
Regtsted ad comitted as obvious. Honza Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 207591) +++ testsuite/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2014-02-06 Jan Hubicka <hubi...@ucw.cz> + + PR ipa/59918 + * g++.dg/torture/pr59918.C: New testcase. + 2014-02-06 Jakub Jelinek <ja...@redhat.com> PR target/59575 Index: testsuite/g++.dg/torture/pr59918.C =================================================================== --- testsuite/g++.dg/torture/pr59918.C (revision 0) +++ testsuite/g++.dg/torture/pr59918.C (revision 0) @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +struct E { + ~E(); + virtual void f() const; +}; +struct B : E {}; +struct G : virtual B {}; +struct A { + virtual ~A(); +}; +struct J : E { + void f() const { + E *p = 0; + p->f(); + } +}; +J h; +struct I : A, G, virtual B {}; Index: ChangeLog =================================================================== --- ChangeLog (revision 207591) +++ ChangeLog (working copy) @@ -1,5 +1,10 @@ 2014-02-06 Jan Hubicka <hubi...@ucw.cz> + PR ipa/59918 + * ipa-devirt.c (record_target_from_binfo): Remove overactive sanity check. + +2014-02-06 Jan Hubicka <hubi...@ucw.cz> + PR ipa/59469 * lto-cgraph.c (lto_output_node): Use symtab_get_symbol_partitioning_class. Index: ipa-devirt.c =================================================================== --- ipa-devirt.c (revision 207588) +++ ipa-devirt.c (working copy) @@ -689,10 +689,7 @@ record_target_from_binfo (vec <cgraph_no we may not have its associated vtable. This is not a problem, since we will walk it on the other path. */ if (!type_binfo) - { - gcc_assert (BINFO_VIRTUAL_P (binfo)); - return; - } + return; tree inner_binfo = get_binfo_at_offset (type_binfo, offset, otr_type); /* For types in anonymous namespace first check if the respective vtable