https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133
--- Comment #26 from Martin Jambor <jamborm at gcc dot gnu.org> --- If fntype specifies the ABI then when we know we will be calling a different function (which might have its prototype modified for example by parameter removal), then we should set the fntype too. And further inspection of cgraph_edge::redirect_call_stmt_to_callee also suggests that is the correct thing. Therefore I'll bootstrap the patch from comment #20 and propose it on the mailing list. While the committed patch does prevent the ICE, I would actually prefer if gimple checking failed when it encounters a direct call with mismatching fntype. It can't happen because of this bug but I suppose we might get wrong-code generation if we get the type only slightly wrong.