Make -fzero-call-used-regs work on the SPARC
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 1 Dec 2020 20:12:54 +0000 (21:12 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Tue, 1 Dec 2020 20:15:53 +0000 (21:15 +0100)
commitb3147c02dc772ad77eb7e1d5d6e14a8f222d1e65
tree3e53fe0b7cf68f44db64ec22408d498fa385287e
parent986bb15d5b375829f8858c2906dab1012166194f
Make -fzero-call-used-regs work on the SPARC

This contains both a generic fixlet for targets implementing the leaf
register optimization (SPARC and Xtensa) and the implementation of the
target hook TARGET_ZERO_CALL_USED_REGS which is needed to make this work
on the SPARC.

gcc/ChangeLog:
* function.c (gen_call_used_regs_seq): In a function subject to the
leaf register optimization, skip registers that are not present.
* config/sparc/sparc.c (TARGET_ZERO_CALL_USED_REGS): Define to...
(sparc_zero_call_used_regs): ...this.  New function.
gcc/config/sparc/sparc.c
gcc/function.c