https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67600
--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> --- OK, the problem is that we loss offset of 64. This happens in get_dynamic_type where we restrict to inner class and get difference in between offset inside restricted type and offset from basic instance pointer. I am testing the following: Index: ipa-polymorphic-call.c =================================================================== --- ipa-polymorphic-call.c (revision 228735) +++ ipa-polymorphic-call.c (working copy) @@ -1621,13 +1637,13 @@ ipa_polymorphic_call_context::get_dynami print_generic_expr (dump_file, otr_object, TDF_SLIM); fprintf (dump_file, " Outer instance pointer: "); print_generic_expr (dump_file, instance, TDF_SLIM); - fprintf (dump_file, " offset: %i (bits)", (int)offset); + fprintf (dump_file, " offset: %i (bits)", (int)instance_offset); fprintf (dump_file, " vtbl reference: "); print_generic_expr (dump_file, instance_ref, TDF_SLIM); fprintf (dump_file, "\n"); } - tci.offset = offset; + tci.offset = instance_offset; tci.instance = instance; tci.vtbl_ptr_ref = instance_ref; gcc_assert (TREE_CODE (instance) != MEM_REF); will need to re-read the code to double check it works as intended now, but I would think so ;) Honza