Re: [PATCH 1/4] x86: Add -mindirect-branch=

2018-01-13 Thread H.J. Lu
On Sat, Jan 13, 2018 at 9:30 AM, Jan Hubicka wrote: >> On Sat, Jan 13, 2018 at 7:56 AM, Jan Hubicka wrote: >> >> >> +/* Output a funtion with a call and return thunk for indirect branch. >> >> >> + If BND_P is true, the BND prefix is needed. If REGNO != -1,

Re: [PATCH 1/4] x86: Add -mindirect-branch=

2018-01-13 Thread Jan Hubicka
> On Sat, Jan 13, 2018 at 7:56 AM, Jan Hubicka wrote: > >> >> +/* Output a funtion with a call and return thunk for indirect branch. > >> >> + If BND_P is true, the BND prefix is needed. If REGNO != -1, the > >> >> + function address is in REGNO. Otherwise, the function

Re: [PATCH 1/4] x86: Add -mindirect-branch=

2018-01-13 Thread H.J. Lu
On Sat, Jan 13, 2018 at 7:56 AM, Jan Hubicka wrote: >> >> +/* Output a funtion with a call and return thunk for indirect branch. >> >> + If BND_P is true, the BND prefix is needed. If REGNO != -1, the >> >> + function address is in REGNO. Otherwise, the function address is

Re: [PATCH 1/4] x86: Add -mindirect-branch=

2018-01-13 Thread Jan Hubicka
> >> +/* Output a funtion with a call and return thunk for indirect branch. > >> + If BND_P is true, the BND prefix is needed. If REGNO != -1, the > >> + function address is in REGNO. Otherwise, the function address is > >> + on the top of stack. */ > >> + > >> +static void > >>

Re: [PATCH 1/4] x86: Add -mindirect-branch=

2018-01-13 Thread H.J. Lu
On Fri, Jan 12, 2018 at 9:47 AM, Jan Hubicka wrote: >> gcc/ >> >> * config/i386/i386-opts.h (indirect_branch): New. >> * config/i386/i386-protos.h (ix86_output_indirect_jmp): Likewise. >> * config/i386/i386.c (ix86_using_red_zone): Disallow red-zone >> with

Re: [PATCH 1/4] x86: Add -mindirect-branch=

2018-01-12 Thread Jan Hubicka
> gcc/ > > * config/i386/i386-opts.h (indirect_branch): New. > * config/i386/i386-protos.h (ix86_output_indirect_jmp): Likewise. > * config/i386/i386.c (ix86_using_red_zone): Disallow red-zone > with local indirect jump when converting indirect call and jump. >

[PATCH 1/4] x86: Add -mindirect-branch=

2018-01-12 Thread H.J. Lu
Add -mindirect-branch= option to convert indirect call and jump to call and return thunks. The default is 'keep', which keeps indirect call and jump unmodified. 'thunk' converts indirect call and jump to call and return thunk. 'thunk-inline' converts indirect call and jump to inlined call and