https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71146
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> --- And of course I found it (I think) just after posting the previous commit: --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4486,6 +4486,7 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) update_stmt (stmt); id->src_node->remove (); expand_call_inline (bb, stmt, id); + maybe_remove_unused_call_args (cfun, stmt); return true; } fn = cg_edge->callee->decl;