> On Mon, Feb 26, 2018 at 2:05 AM, Martin Liška <mli...@suse.cz> wrote: > > On 02/25/2018 02:37 AM, H.J. Lu wrote: > >> PR target/r84530 > > > > Just a nit I've noticed: > > > > s/r84530/84530 > > Fixed. > > -- > H.J.
> From f08b8721ed038cefcee5a0bb1329b90a2d322269 Mon Sep 17 00:00:00 2001 > From: "H.J. Lu" <hjl.to...@gmail.com> > Date: Sat, 24 Feb 2018 05:05:49 -0800 > Subject: [PATCH] i386: Update -mfunction-return= for return with pop > > When -mfunction-return= is used, simple_return_pop_internal should pop > return address into ECX register, adjust stack by bytes to pop from stack > and jump to the return thunk via ECX register. > > Tested on i686 and x86-64. > > PR target/84530 > * config/i386/i386-protos.h (ix86_output_indirect_jmp): Remove > the bool argument. > (ix86_output_indirect_function_return): New prototype. > (ix86_split_simple_return_pop_internal): Likewise. > * config/i386/i386.c (indirect_return_via_cx): New. > (indirect_return_via_cx_bnd): Likewise. > (indirect_thunk_name): Handle return va CX_REG. > (output_indirect_thunk_function): Create alias for > __x86_return_thunk_[re]cx and __x86_return_thunk_[re]cx_bnd. > (ix86_output_indirect_jmp): Remove the bool argument. > (ix86_output_indirect_function_return): New function. > (ix86_split_simple_return_pop_internal): Likewise. > * config/i386/i386.md (*indirect_jump): Don't pass false > to ix86_output_indirect_jmp. > (*tablejump_1): Likewise. > (simple_return_pop_internal): Change it to define_insn_and_split. > Call ix86_split_simple_return_pop_internal to split it for > -mfunction-return=. > (simple_return_indirect_internal): Call > ix86_output_indirect_function_return instead of > ix86_output_indirect_jmp. It seems to make sense. Since LLVM has picked up our thunk names now, I wonder if they have same bug or someohow already assigned a name to this thunk. In the second case we probably ought to match it. Do you know what LLVM uses? Honza