https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67133
--- Comment #19 from Marek Polacek <mpolacek at gcc dot gnu.org> --- I'm testing --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -2949,6 +2949,8 @@ maybe_remove_unused_call_args (struct function *fn, gimple stmt) && TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))) == void_type_node && gimple_call_num_args (stmt)) { + tree fntype = gimple_call_fntype (stmt); + TYPE_ATTRIBUTES (fntype) = DECL_ATTRIBUTES (decl); gimple_set_num_ops (stmt, 3); update_stmt_fn (fn, stmt); } instead