]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xtensa: Use epilogue_completed rather than cfun->machine->epilogue_done
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Thu, 30 May 2024 13:32:24 +0000 (22:32 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Fri, 31 May 2024 06:24:26 +0000 (23:24 -0700)
In commit ad89d820bf, an "epilogue_done" member was added to the
machine_function structure, but it is sufficient to use the existing
"epilogue_completed" global variable.

gcc/ChangeLog:

* config/xtensa/xtensa-protos.h
(xtensa_use_return_instruction_p): Remove.
* config/xtensa/xtensa.cc
(machine_function): Remove "epilogue_done" field.
(xtensa_expand_epilogue): Remove "cfun->machine->epilogue_done" usage.
(xtensa_use_return_instruction_p): Remove.
* config/xtensa/xtensa.md ("return"):
Replace calling "xtensa_use_return_instruction_p()" with inline code.

gcc/config/xtensa/xtensa-protos.h
gcc/config/xtensa/xtensa.cc
gcc/config/xtensa/xtensa.md

index 508d5b28aa2bc708ab1eddfc79e110fdf8ccffd0..b87b3e8ac481d3bba08e4eeb3047ae07f8bdee02 100644 (file)
@@ -76,7 +76,6 @@ extern rtx xtensa_return_addr (int, rtx);
 extern void xtensa_setup_frame_addresses (void);
 extern int xtensa_debugger_regno (int);
 extern long compute_frame_size (poly_int64);
-extern bool xtensa_use_return_instruction_p (void);
 extern void xtensa_expand_prologue (void);
 extern void xtensa_expand_epilogue (bool);
 extern void xtensa_adjust_reg_alloc_order (void);
index 75973cfbac0b4d94bf84bc150558669e6dc2f529..84268db5c9d0a9bd979e9bae58e2f136fa59033c 100644 (file)
@@ -104,7 +104,6 @@ struct GTY(()) machine_function
      compute_frame_size.  */
   int callee_save_size;
   bool frame_laid_out;
-  bool epilogue_done;
   bool inhibit_logues_a1_adjusts;
   rtx last_logues_a9_content;
   HARD_REG_SET eliminated_callee_saved;
@@ -3747,25 +3746,12 @@ xtensa_expand_epilogue (bool sibcall_p)
                                  stack_pointer_rtx,
                                  EH_RETURN_STACKADJ_RTX));
     }
-  cfun->machine->epilogue_done = true;
   if (sibcall_p)
     emit_use (gen_rtx_REG (SImode, A0_REG));
   else
     emit_jump_insn (gen_return ());
 }
 
-bool
-xtensa_use_return_instruction_p (void)
-{
-  if (!reload_completed)
-    return false;
-  if (TARGET_WINDOWED_ABI)
-    return true;
-  if (compute_frame_size (get_frame_size ()) == 0)
-    return true;
-  return cfun->machine->epilogue_done;
-}
-
 void
 xtensa_set_return_address (rtx address, rtx scratch)
 {
index 1b82a12d879baf54b08b8343e8756ce1e78c8b0f..6061a86ee13608675e2f95fbff654c1dab4fb478 100644 (file)
 (define_insn "return"
   [(return)
    (use (reg:SI A0_REG))]
-  "xtensa_use_return_instruction_p ()"
+  "reload_completed
+   && (TARGET_WINDOWED_ABI
+       || compute_frame_size (get_frame_size ()) == 0
+       || epilogue_completed)"
 {
   return TARGET_WINDOWED_ABI ?
       (TARGET_DENSITY ? "retw.n" : "retw") :