public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: LuluCheng <chenglulu@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-9840] LoongArch: Fix bug in loongarch_emit_stack_tie [PR110484]. Date: Fri, 1 Sep 2023 03:23:52 +0000 (GMT) [thread overview] Message-ID: <20230901032352.DD5D2385B512@sourceware.org> (raw) https://gcc.gnu.org/g:d60c00492eb5818493560f299f06d1e3d9efcc69 commit r12-9840-gd60c00492eb5818493560f299f06d1e3d9efcc69 Author: Lulu Cheng <chenglulu@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 <guojie@loongson.cn> (cherry picked from commit 1967f21d000e09d3d3190317af7923b578ce02b1) Diff: --- gcc/config/loongarch/loongarch.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index 22901cb61010..9cc9c74cd73d 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -1098,7 +1098,9 @@ loongarch_first_stack_step (struct loongarch_frame_info *frame) static void loongarch_emit_stack_tie (void) { - emit_insn (gen_stack_tie (Pmode, stack_pointer_rtx, hard_frame_pointer_rtx)); + emit_insn (gen_stack_tie (Pmode, stack_pointer_rtx, + frame_pointer_needed ? hard_frame_pointer_rtx + : stack_pointer_rtx)); } #define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP)
reply other threads:[~2023-09-01 3:23 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230901032352.DD5D2385B512@sourceware.org \ --to=chenglulu@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).