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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |trippels at gcc dot gnu.org

--- Comment #8 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Honza,

I've tested your patch from comment 7 and it doesn't work.
However your suggestion "to simply return NULL when inner_binfo is NULL"
does seem to work fine. I've successfully build Chromium with it.

diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index f5b5926504c7..c0fce4cde069 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -648,6 +648,8 @@ record_target_from_binfo (vec <cgraph_node *> &nodes,
     {
       tree inner_binfo = get_binfo_at_offset (type_binfo,
                                              offset, otr_type);
+      if (!inner_binfo)
+       return;
       /* For types in anonymous namespace first check if the respective vtable
         is alive. If not, we know the type can't be called.  */
       if (!flag_ltrans && anonymous)
@@ -661,7 +663,6 @@ record_target_from_binfo (vec <cgraph_node *> &nodes,
          if (!vnode || !vnode->definition)
            return;
        }
-      gcc_assert (inner_binfo);
       if (!pointer_set_insert (matched_vtables, BINFO_VTABLE (inner_binfo)))
        {
          tree target = gimple_get_virt_method_for_binfo (otr_token,
inner_binfo);

Reply via email to