On Sun, 2026-07-05 at 16:28 +0900, Oleg Endo wrote:
> While digging in the mode switching stuff I ran across this one. It's an
> easy fix, just for the sake of it. Nothing really seems to be using or
> relying on this and I'm planning to axe the -mfmovd option in the near
> future.
>
> Committed to master.
>
> Best regards,
> Oleg Endo
>
> gcc/ChangeLog:
> PR target/67643
> * config/sh/sh.cc (fpscr_set_from_mem): Specify a post-inc memory
> operand for lds_fpscr after RA.
>
> gcc/testsuite/ChangeLog:
> PR target/67643
> * gcc.target/sh/pr67643.c: New test.
Oops, failed to rebuild and double check it after shuffling the code lines
around after the initial confirmed fix. Should be good now. Committed to
master.
gcc/ChangeLog:
PR target/67643
PR target/126117
* config/sh/sh.cc (fpscr_set_from_mem): Add missing argument to
get_free_reg invocation.
From f50679ec5db3f4b33f793caa15344355bca7c45d Mon Sep 17 00:00:00 2001
From: Oleg Endo <[email protected]>
Date: Sun, 5 Jul 2026 18:10:04 +0900
Subject: [PATCH] SH: Fix PR 67643 amendment of commit b6b9318ac9e72d6e
gcc/ChangeLog:
PR target/67643
PR target/126117
* config/sh/sh.cc (fpscr_set_from_mem): Add missing argument to
get_free_reg invocation.
---
gcc/config/sh/sh.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/sh/sh.cc b/gcc/config/sh/sh.cc
index abc073c..05b0060 100644
--- a/gcc/config/sh/sh.cc
+++ b/gcc/config/sh/sh.cc
@@ -8902,7 +8902,7 @@ fpscr_set_from_mem (int mode, HARD_REG_SET regs_live)
{
// After RA it needs the address with a post-inc mem or else it will
// result in an unrecognizable insn.
- rtx scratch = get_free_reg ();
+ rtx scratch = get_free_reg (regs_live);
emit_move_insn (scratch, XEXP (src, 0));
if (index != 0)
emit_insn (gen_addsi3 (scratch, scratch, GEN_INT (index * 4)));
--
libgit2 1.9.0