https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66351
--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Hello, the following patch should fix the miscompilation: Index: ipa-polymorphic-call.c =================================================================== --- ipa-polymorphic-call.c (revision 224053) +++ ipa-polymorphic-call.c (working copy) @@ -1602,6 +1603,8 @@ } } } + if (!instance_ref) + return false; } } this issue here is that for OBJ_TYPE_REF we start the alias oracle walk looking for vtbl change from wrong instruction - it should not start by call, it should start by load of vptr. This path is originally copied from ipa-prop code so it was in for a while. Reason why i did not commit the patch to mianline yet is that I do not 100% understand why it breaks in case of ipa-icf.c because the load should alias with the vptr store, too. What happens is that the call is devirtualized by GVN first, so perhaps we turn the call to pure and lose the link, but I wanted to analyze this first. I will bootstrap and regtest the patch on x86_64 and I guess it should go in if it fixes the ia64 bootstrap issue (which i can't test apparently).