]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/config/xtensa/xtensa.cc
xtensa: Make register A0 allocable for the CALL0 ABI
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Fri, 21 Oct 2022 22:46:13 +0000 (07:46 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Sat, 22 Oct 2022 07:23:02 +0000 (00:23 -0700)
commite0927d7ddca154b1a5151da698e205593cb8912e
tree3d3ed9ce0c0c552d6c5899acc81d698840f7ecdd
parent1043971957af092e265cc4553b2382398d7308ae
xtensa: Make register A0 allocable for the CALL0 ABI

This patch offers an additional allocable register by RA for the CALL0
ABI.

> Register a0 holds the return address upon entry to a function, but
> unlike the windowed register ABI, it is not reserved for this purpose
> and may hold other values after the return address has been saved.
  - Xtensa ISA Reference Manual,
                   8.1.2 "CALL0 Register Usage and Stack Layout" [p.589]

gcc/ChangeLog:

* config/xtensa/xtensa.cc (xtensa_conditional_register_usage):
Remove register A0 from FIXED_REGS if the CALL0 ABI.
(xtensa_expand_epilogue): Change to emit '(use (reg:SI A0_REG))'
unconditionally after restoring callee-saved registers for
sibling-call functions, in order to prevent misleading that
register A0 is free to use.
gcc/config/xtensa/xtensa.cc