x86: Allow -fcf-protection with external thunk
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 29 Apr 2020 11:52:46 +0000 (04:52 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 29 Apr 2020 11:53:02 +0000 (04:53 -0700)
commit9be3bb2c0a258fd6a7d3d05d232a21930c757d3c
tree9ef8c3abbb149bc351e1b1f09038177c0240f003
parent668d8f3c0c61905bc69a1c73f16fa4fa6273db2a
x86: Allow -fcf-protection with external thunk

Allow -fcf-protection with external thunk since the external thunk can be
made compatible with -fcf-protection.

gcc/

PR target/93654
* config/i386/i386-options.c (ix86_set_indirect_branch_type):
Allow -fcf-protection with -mindirect-branch=thunk-extern and
-mfunction-return=thunk-extern.
* doc/invoke.texi: Update notes for -fcf-protection=branch with
-mindirect-branch=thunk-extern and -mindirect-return=thunk-extern.

gcc/testsuite/

PR target/93654
* gcc.target/i386/pr93654.c: New test.
gcc/ChangeLog
gcc/config/i386/i386-options.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr93654.c [new file with mode: 0644]