https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99988
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Alex Coplan <acop...@gcc.gnu.org>: https://gcc.gnu.org/g:1011bb8bc67cf34c45a9237d72a801a14ad9ef0f commit r11-8379-g1011bb8bc67cf34c45a9237d72a801a14ad9ef0f 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.