From: Andrew Waterman Date: Wed, 17 Jan 2018 19:07:20 +0000 (+0000) Subject: RISC-V: Mark fsX as call clobbered when soft-float. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e423d5bc0481ee889c3fa251337978675848b0f4;p=gcc.git RISC-V: Mark fsX as call clobbered when soft-float. 2018-01-17 Andrew Waterman gcc/ * config/riscv/riscv.c (riscv_conditional_register_usage): If UNITS_PER_FP_ARG is 0, set call_used_regs to 1 for all FP regs. From-SVN: r256811 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7b0146b7e52..1943210b556 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-01-17 Andrew Waterman + + * config/riscv/riscv.c (riscv_conditional_register_usage): If + UNITS_PER_FP_ARG is 0, set call_used_regs to 1 for all FP regs. + 2018-01-17 David Malcolm PR lto/83121 diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c index 19a01e0825a..20660a4061a 100644 --- a/gcc/config/riscv/riscv.c +++ b/gcc/config/riscv/riscv.c @@ -4123,6 +4123,13 @@ riscv_conditional_register_usage (void) for (int regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno++) fixed_regs[regno] = call_used_regs[regno] = 1; } + + /* In the soft-float ABI, there are no callee-saved FP registers. */ + if (UNITS_PER_FP_ARG == 0) + { + for (int regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno++) + call_used_regs[regno] = 1; + } } /* Return a register priority for hard reg REGNO. */