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));
 }

Reply via email to