https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110484
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by LuluCheng <chengl...@gcc.gnu.org>: https://gcc.gnu.org/g:3f23fa7e74fa01828d649e8ee7230701b6fb1e19 commit r13-7773-g3f23fa7e74fa01828d649e8ee7230701b6fb1e19 Author: Lulu Cheng <chengl...@loongson.cn> Date: Thu Jun 29 19:30:59 2023 +0800 LoongArch: Fix bug in loongarch_emit_stack_tie [PR110484]. Which may result in implicit references to $fp when frame_pointer_needed is false, causing regs_ever_live[$fp] to be true when $fp is not explicitly used, resulting in $fp being used as the target replacement register in the rnreg pass. The bug originates from SPEC2017 541.leela_r(-flto). gcc/ChangeLog: PR target/110484 * config/loongarch/loongarch.cc (loongarch_emit_stack_tie): Use the frame_pointer_needed to determine whether to use the $fp register. Co-authored-by: Guo Jie <guo...@loongson.cn> (cherry picked from commit 1967f21d000e09d3d3190317af7923b578ce02b1)