https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89355
--- Comment #6 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> --- Author: hjl Date: Fri May 31 23:59:16 2019 New Revision: 271828 URL: https://gcc.gnu.org/viewcvs?rev=271828&root=gcc&view=rev Log: i386: Don't insert ENDBR after NOTE_INSN_DELETED_LABEL NOTE_INSN_DELETED_LABEL is used to mark what used to be a 'code_label', but was not used for other purposes than taking its address which cannot be used as target for indirect jumps. Tested on Linux/x86-64 with -fcf-protection. For x86-64 libc.so on glibc master branch (commit f43b8dd55588c3), Before: 2961 endbr64 After: 2943 endbr64 gcc/ PR target/89355 * config/i386/i386-features.c (rest_of_insert_endbranch): Remove NOTE_INSN_DELETED_LABEL check. gcc/testsuite/ PR target/89355 * gcc.target/i386/cet-label-3.c: New test. * gcc.target/i386/cet-label-4.c: Likewise. * gcc.target/i386/cet-label-5.c: Likewise. Added: trunk/gcc/testsuite/gcc.target/i386/cet-label-3.c trunk/gcc/testsuite/gcc.target/i386/cet-label-4.c trunk/gcc/testsuite/gcc.target/i386/cet-label-5.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386-features.c trunk/gcc/testsuite/ChangeLog