diff options
-rw-r--r-- | gcc/config/xtensa/xtensa-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa.cc | 14 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa.md | 5 |
3 files changed, 4 insertions, 16 deletions
diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h index 508d5b2..b87b3e8 100644 --- a/gcc/config/xtensa/xtensa-protos.h +++ b/gcc/config/xtensa/xtensa-protos.h @@ -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); diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc index 75973cf..84268db 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -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) { diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index 1b82a12..6061a86 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -2735,7 +2735,10 @@ (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") : |