[Bug c++/110484] Spec2017 541 after adding the '-flto-fomit-frame-pointer' optimization, after optimizing the rnreg, directly replaced other registers with the $r22 register, so that the value of the $r22 register was destroyed without being saved.
chenglulu at loongson dot cn
gcc-bugzilla@gcc.gnu.org
Thu Jun 29 12:07:11 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110484
--- Comment #1 from chenglulu <chenglulu at loongson dot cn> ---
The following code modification problem can be solved:
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -1112,7 +1112,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));
}
More information about the Gcc-bugs
mailing list