https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65236
--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> --- This is the code generated for thunk: _Z5test11A: .LFB12: .cfi_startproc pushq %rbx .cfi_def_cfa_offset 16 .cfi_offset 3, -16 movq %rdi, %rbx subq $16, %rsp .cfi_def_cfa_offset 32 movq %rsp, %rdi call _Z5test21A movq (%rsp), %rax movq %rax, (%rbx) movq 8(%rsp), %rax movq %rax, 8(%rbx) addq $16, %rsp .cfi_def_cfa_offset 16 movq %rbx, %rax popq %rbx .cfi_def_cfa_offset 8 ret which is wrong; the extra copy should not exist.