On Fri, Oct 21, 2022 at 3:46 PM Takayuki 'January June' Suwa
<jjsuwa_sys3...@yahoo.co.jp> wrote:
>
> 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 | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)

Regtested for target=xtensa-linux-uclibc, no new regressions.
Committed to master.

-- 
Thanks.
-- Max

Reply via email to