https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99988
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Alex Coplan <acop...@gcc.gnu.org>: https://gcc.gnu.org/g:419c243dfb9aba51aceb1370a241db082847eeb5 commit r10-9818-g419c243dfb9aba51aceb1370a241db082847eeb5 Author: Alex Coplan <alex.cop...@arm.com> Date: Wed Apr 21 14:42:04 2021 +0100 aarch64: Avoid duplicating bti j insns for jump tables [PR99988] This patch fixes PR99988 which shows us generating large (> 250) sequences of back-to-back bti j instructions. The fix is simply to avoid inserting bti j instructions at the target of a jump table if we've already inserted one for a given label. Co-Authored-By: Christophe Lyon <cl...@gcc.gnu.org> gcc/ChangeLog: PR target/99988 * config/aarch64/aarch64-bti-insert.c (aarch64_bti_j_insn_p): New. (rest_of_insert_bti): Avoid inserting duplicate bti j insns for jump table targets. gcc/testsuite/ChangeLog: PR target/99988 * gcc.target/aarch64/pr99988.c: New test. (cherry picked from commit 1011bb8bc67cf34c45a9237d72a801a14ad9ef0f)