diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-12-01 21:12:54 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2020-12-01 21:15:53 +0100 |
commit | b3147c02dc772ad77eb7e1d5d6e14a8f222d1e65 (patch) | |
tree | 3e53fe0b7cf68f44db64ec22408d498fa385287e /gcc/function.c | |
parent | 986bb15d5b375829f8858c2906dab1012166194f (diff) | |
download | gcc-b3147c02dc772ad77eb7e1d5d6e14a8f222d1e65.zip gcc-b3147c02dc772ad77eb7e1d5d6e14a8f222d1e65.tar.gz gcc-b3147c02dc772ad77eb7e1d5d6e14a8f222d1e65.tar.bz2 |
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.
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c index 004fa38..59fd72b 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5880,6 +5880,10 @@ gen_call_used_regs_seq (rtx_insn *ret, unsigned int zero_regs_type) continue; if (only_arg && !FUNCTION_ARG_REGNO_P (regno)) continue; +#ifdef LEAF_REG_REMAP + if (crtl->uses_only_leaf_regs && LEAF_REG_REMAP (regno) < 0) + continue; +#endif /* Now this is a register that we might want to zero. */ SET_HARD_REG_BIT (selected_hardregs, regno); |