PR84066 Wrong shadow stack register size is saved for x32
authorIgor Tsimbalist <igor.v.tsimbalist@intel.com>
Fri, 2 Feb 2018 10:06:39 +0000 (11:06 +0100)
committerIgor Tsimbalist <itsimbal@gcc.gnu.org>
Fri, 2 Feb 2018 10:06:39 +0000 (11:06 +0100)
commite8a5a6f6e2e4e06b8e8d357712277fb54ed71b07
tree4b9d182199d033a4586990c2ae1786953643e0a3
parentfe23b12a23e357103a40fda08df33f3547f112e6
PR84066 Wrong shadow stack register size is saved for x32

x32 is a 64-bit process with 32-bit software pointer and kernel may
place x32 shadow stack above 4GB.  We need to save and restore 64-bit
shadow stack register for x32. builtin jmp buf size is 5 pointers.  We
have space to save 64-bit shadow stack pointers: 32-bit SP, 32-bit FP,
32-bit IP, 64-bit SSP for x32.

PR target/84066
* gcc/config/i386/i386.md: Replace Pmode with word_mode in
builtin_setjmp_setup and builtin_longjmp to support x32.
* gcc/testsuite/gcc.target/i386/cet-sjlj-6a.c: New test.
* gcc/testsuite/gcc.target/i386/cet-sjlj-6b.c: Likewise.

From-SVN: r257326
gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/cet-sjlj-6a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/cet-sjlj-6b.c [new file with mode: 0644]