https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77333
--- Comment #16 from Martin Jambor <jamborm at gcc dot gnu.org> --- Please check whether the following patch (it is against trunk should apply on top of GCC 6 too) fixes the issue for you. It can potentially open a whole can of worms so I want to make sure it helps before taking it further. Even if it does, I would also like to ask you to run the whole gcc testsuite (as many languages as you can) with and without the patch on i686-w64-mingw32 and compare the results before I propose it on the mailing list. diff --git a/gcc/cgraph.c b/gcc/cgraph.c index ef2dc50282c..29ec61b3d0d 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1425,7 +1425,7 @@ cgraph_edge::redirect_call_stmt_to_callee (void) new_stmt = chkp_copy_call_skip_bounds (new_stmt); gimple_call_set_fndecl (new_stmt, e->callee->decl); - gimple_call_set_fntype (new_stmt, gimple_call_fntype (e->call_stmt)); + gimple_call_set_fntype (new_stmt, TREE_TYPE (e->callee->decl)); if (gimple_vdef (new_stmt) && TREE_CODE (gimple_vdef (new_stmt)) == SSA_NAME)