https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110136
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by LuluCheng <chengl...@gcc.gnu.org>: https://gcc.gnu.org/g:ddec24e5abe99033c8d6bbe544b4c2b35a0232f2 commit r12-9698-gddec24e5abe99033c8d6bbe544b4c2b35a0232f2 Author: Lulu Cheng <chengl...@loongson.cn> Date: Wed Jun 7 10:21:58 2023 +0800 LoongArch: Avoid non-returning indirect jumps through $ra [PR110136] Micro-architecture unconditionally treats a "jr $ra" as "return from subroutine", hence doing "jr $ra" would interfere with both subroutine return prediction and the more general indirect branch prediction. Therefore, a problem like PR110136 can cause a significant increase in branch error prediction rate and affect performance. The same problem exists with "indirect_jump". gcc/ChangeLog: PR target/110136 * config/loongarch/loongarch.md: Modify the register constraints for template "jumptable" and "indirect_jump" from "r" to "e". Co-authored-by: Andrew Pinski <apin...@marvell.com> (cherry picked from commit 5430c86e71927492399129f3df80824c6c334ddf)