https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64282
--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> --- The reduced testcase does not seem to reproduce for me. The ICE is however just overactive sanity check - the program is invalid and accesses random data as vtable pointer. In this case we can just optimize to unreachable instead of ICEing. I am testing the following: Index: gimple-fold.c =================================================================== --- gimple-fold.c (revision 219876) +++ gimple-fold.c (working copy) @@ -5649,7 +5649,6 @@ gimple_get_virt_method_for_vtable (HOST_ if (TREE_CODE (v) != VAR_DECL || !DECL_VIRTUAL_P (v)) { - gcc_assert (in_lto_p); /* Pass down that we lost track of the target. */ if (can_refer) *can_refer = false;