Merged two changes into one patch, and committed to master :)
On Mon, Oct 24, 2022 at 10:28 AM <juzhe.zh...@rivai.ai> wrote: > > From: Ju-Zhe Zhong <juzhe.zh...@rivai.ai> > > gcc/ChangeLog: > > * config/riscv/riscv.cc (riscv_legitimize_move): Adjust using > force_reg. > > --- > gcc/config/riscv/riscv.cc | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc > index 98374a922d1..1fd34f6ae8d 100644 > --- a/gcc/config/riscv/riscv.cc > +++ b/gcc/config/riscv/riscv.cc > @@ -1967,9 +1967,7 @@ riscv_legitimize_move (machine_mode mode, rtx dest, rtx > src) > */ > if (MEM_P (dest)) > { > - rtx tmp = gen_reg_rtx (mode); > - emit_move_insn (tmp, src); > - emit_move_insn (dest, tmp); > + emit_move_insn (dest, force_reg (mode, src)); > return true; > } > poly_int64 value = rtx_to_poly_int64 (src); > -- > 2.36.1 >