i386: Add save_stack_nonlocal and restore_stack_nonlocal
authorH.J. Lu <hongjiu.lu@intel.com>
Thu, 19 Apr 2018 16:36:34 +0000 (16:36 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 19 Apr 2018 16:36:34 +0000 (09:36 -0700)
commit5e1e91c4fdd5946556e8d4e4520dbb643a2e7b5e
treeed7f9067c97293bce49d41b27ec4b0d75a7b7b0e
parent2130a2afe7e45001936bb55b8ba1340c54953bbd
i386: Add save_stack_nonlocal and restore_stack_nonlocal

Define STACK_SAVEAREA_MODE to hold both shadow stack and stack pointers.
Replace builtin_setjmp_setup and builtin_longjmp with save_stack_nonlocal
and restore_stack_nonlocal to support both builtin setjmp/longjmp as well
as non-local goto in nested functions.

gcc/

PR target/85397
* config/i386/i386.h (STACK_SAVEAREA_MODE): New.
* config/i386/i386.md (builtin_setjmp_setup): Removed.
(builtin_longjmp): Likewise.
(save_stack_nonlocal): New pattern.
(restore_stack_nonlocal): Likewise.

gcc/testsuite/

PR target/85397
* gcc.dg/torture/pr85397-1.c: New test.
* gcc.target/i386/cet-sjlj-6a.c: Adjusted.
* gcc.target/i386/cet-sjlj-6b.c: Likewise.

From-SVN: r259500
gcc/ChangeLog
gcc/config/i386/i386.h
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr85397-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/cet-sjlj-6a.c
gcc/testsuite/gcc.target/i386/cet-sjlj-6b.c