i386: Don't insert ENDBR at function entrance when called directly
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 24 Oct 2017 10:52:50 +0000 (10:52 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 24 Oct 2017 10:52:50 +0000 (03:52 -0700)
commitec8f7ce60791b582ce377eac47d14ee9122c557e
tree61d5dfbbc1cb4ca1148dc14fbdcef62d8b3f1668
parentb75200689b0d86be5c3b91afb7303575359622ae
i386: Don't insert ENDBR at function entrance when called directly

There is no need to insert ENDBR instruction at function entrance if
function is only called directly.

gcc/

PR target/82659
* config/i386/i386.c (rest_of_insert_endbranch): Don't insert
ENDBR instruction at function entrance if function is only
called directly.

gcc/testsuite/

PR target/82659
* gcc.target/i386/cet-label-2.c: New test.
* gcc.target/i386/cet-sjlj-4.c: Likewise.
* gcc.target/i386/cet-sjlj-5.c: Likewise.
* gcc.target/i386/cet-switch-3.c: Likewise.
* gcc.target/i386/pr82659-1.c: Likewise.
* gcc.target/i386/pr82659-2.c: Likewise.
* gcc.target/i386/pr82659-3.c: Likewise.
* gcc.target/i386/pr82659-4.c: Likewise.
* gcc.target/i386/pr82659-5.c: Likewise.
* gcc.target/i386/pr82659-6.c: Likewise.

From-SVN: r254040
13 files changed:
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/cet-label-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/cet-sjlj-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/cet-sjlj-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/cet-switch-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82659-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82659-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82659-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82659-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82659-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82659-6.c [new file with mode: 0644]