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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
We have

(int (*__vtbl_ptr_type) ()) &_ZTI1S

at this point:

3219      fn = fold_ctor_reference (TREE_TYPE (TREE_TYPE (v)), init,
3220                    offset, size, v);
3221      if (!fn || integer_zerop (fn))
3222        return NULL_TREE;
3223      gcc_assert (TREE_CODE (fn) == ADDR_EXPR
3224              || TREE_CODE (fn) == FDESC_EXPR);

(gdb) p v
$2 = <var_decl 0x7ffff6d77c78 _ZTV1S>

The vtable layout does not match (so we have a ODR violation here).  It
would be helpful to not ICE and maybe diagnose this.

Not ICEing is simple by giving up instead of asserting in
gimple_get_virt_method_for_binfo.

We shouldn't merge any of the non-matching vtables though and thus not the
types either.  So I'm not yet sure how the "wrong" type can end up here.

Reply via email to