diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2023-02-21 11:49:35 -0800 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2023-02-21 13:53:01 -0800 |
commit | b2ef02e8cbbaf95fee98be255f697f47193960ec (patch) | |
tree | e18cdfc5c6045a1c513bd5d816eaa83cc0f16969 | |
parent | 6c1b825b3d6499dfeacf7c79dcf4b56a393ac204 (diff) | |
download | gcc-b2ef02e8cbbaf95fee98be255f697f47193960ec.zip gcc-b2ef02e8cbbaf95fee98be255f697f47193960ec.tar.gz gcc-b2ef02e8cbbaf95fee98be255f697f47193960ec.tar.bz2 |
gcc: xtensa: fix PR target/108876
gcc/
PR target/108876
* config/xtensa/xtensa.cc (xtensa_expand_epilogue): Drop emit_use
for A0_REG.
* config/xtensa/xtensa.md (sibcall, sibcall_internal)
(sibcall_value, sibcall_value_internal): Add 'use' expression
for A0_REG.
-rw-r--r-- | gcc/config/xtensa/xtensa.cc | 2 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa.md | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc index d0320ef..5c1c713 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -3548,8 +3548,6 @@ xtensa_expand_epilogue (bool sibcall_p) gen_frame_mem (SImode, x)); } } - if (sibcall_p) - emit_use (gen_rtx_REG (SImode, A0_REG)); if (cfun->machine->current_frame_size > 0) { diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index d3996b2..b8a8aaf 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -2369,8 +2369,10 @@ (set_attr "length" "3")]) (define_expand "sibcall" - [(call (match_operand 0 "memory_operand" "") - (match_operand 1 "" ""))] + [(parallel [ + (call (match_operand 0 "memory_operand" "") + (match_operand 1 "" "")) + (use (reg:SI A0_REG))])] "!TARGET_WINDOWED_ABI" { xtensa_prepare_expand_call (0, operands); @@ -2378,7 +2380,8 @@ (define_insn "sibcall_internal" [(call (mem:SI (match_operand:SI 0 "call_insn_operand" "nic")) - (match_operand 1 "" "i"))] + (match_operand 1 "" "i")) + (use (reg:SI A0_REG))] "!TARGET_WINDOWED_ABI && SIBLING_CALL_P (insn)" { return xtensa_emit_sibcall (0, operands); @@ -2388,9 +2391,11 @@ (set_attr "length" "3")]) (define_expand "sibcall_value" - [(set (match_operand 0 "register_operand" "") - (call (match_operand 1 "memory_operand" "") - (match_operand 2 "" "")))] + [(parallel [ + (set (match_operand 0 "register_operand" "") + (call (match_operand 1 "memory_operand" "") + (match_operand 2 "" ""))) + (use (reg:SI A0_REG))])] "!TARGET_WINDOWED_ABI" { xtensa_prepare_expand_call (1, operands); @@ -2399,7 +2404,8 @@ (define_insn "sibcall_value_internal" [(set (match_operand 0 "register_operand" "=a") (call (mem:SI (match_operand:SI 1 "call_insn_operand" "nic")) - (match_operand 2 "" "i")))] + (match_operand 2 "" "i"))) + (use (reg:SI A0_REG))] "!TARGET_WINDOWED_ABI && SIBLING_CALL_P (insn)" { return xtensa_emit_sibcall (1, operands); |