[PATCH] x86: Always save and restore shadow stack pointer

2021-02-08 Thread H.J. Lu via Gcc-patches
When the SHSTK feature is not available or not enabled, RDSSP is a NOP, always save and restore shadow stack pointer to support compiling source codes, containing __builtin_setjmp and __builtin_longjmp, with different -fcf-protection options. PR target/98997 * config/i386/i386.md (

Re: [PATCH] x86: Always save and restore shadow stack pointer

2021-02-09 Thread Richard Biener via Gcc-patches
On Mon, Feb 8, 2021 at 3:07 PM H.J. Lu via Gcc-patches wrote: > > When the SHSTK feature is not available or not enabled, RDSSP is a NOP, > always save and restore shadow stack pointer to support compiling source > codes, containing __builtin_setjmp and __builtin_longjmp, with different > -fcf-pro

Re: [PATCH] x86: Always save and restore shadow stack pointer

2021-02-09 Thread H.J. Lu via Gcc-patches
On Tue, Feb 9, 2021 at 12:59 AM Richard Biener wrote: > > On Mon, Feb 8, 2021 at 3:07 PM H.J. Lu via Gcc-patches > wrote: > > > > When the SHSTK feature is not available or not enabled, RDSSP is a NOP, > > always save and restore shadow stack pointer to support compiling source > > codes, contain

Re: [PATCH] x86: Always save and restore shadow stack pointer

2021-02-09 Thread Richard Biener via Gcc-patches
On Tue, Feb 9, 2021 at 2:11 PM H.J. Lu wrote: > > On Tue, Feb 9, 2021 at 12:59 AM Richard Biener > wrote: > > > > On Mon, Feb 8, 2021 at 3:07 PM H.J. Lu via Gcc-patches > > wrote: > > > > > > When the SHSTK feature is not available or not enabled, RDSSP is a NOP, > > > always save and restore sh

Re: [PATCH] x86: Always save and restore shadow stack pointer

2021-02-09 Thread H.J. Lu via Gcc-patches
On Tue, Feb 9, 2021 at 6:19 AM Richard Biener wrote: > > On Tue, Feb 9, 2021 at 2:11 PM H.J. Lu wrote: > > > > On Tue, Feb 9, 2021 at 12:59 AM Richard Biener > > wrote: > > > > > > On Mon, Feb 8, 2021 at 3:07 PM H.J. Lu via Gcc-patches > > > wrote: > > > > > > > > When the SHSTK feature is not

Re: [PATCH] x86: Always save and restore shadow stack pointer

2021-02-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 09, 2021 at 06:25:10AM -0800, H.J. Lu via Gcc-patches wrote: > My patch does nothing for GCC 10. > > > files from GCC 11 > > and -fcf-protection=none (aka the long-year default)? > > > > Yes, if __builtin_setjmp and __builtin_longjmp aren't used. > No, if they are. Therefore ABI chan

Re: [PATCH] x86: Always save and restore shadow stack pointer

2021-02-09 Thread H.J. Lu via Gcc-patches
On Tue, Feb 9, 2021 at 6:33 AM Jakub Jelinek wrote: > > On Tue, Feb 09, 2021 at 06:25:10AM -0800, H.J. Lu via Gcc-patches wrote: > > My patch does nothing for GCC 10. > > > > > files from GCC 11 > > > and -fcf-protection=none (aka the long-year default)? > > > > > > > Yes, if __builtin_setjmp and