On 3/1/2026 11:30 AM, Andrew Pinski wrote:
On Mon, Feb 16, 2026 at 12:07 AM Robin Dapp <[email protected]> wrote:
Hi,

We can perform equivalence substitution in subreg context:

(insn 34 32 36 3 (set (reg:SI 103 [ _7 ])
         (subreg:SI (reg/f:DI 119) 0)) "bla.c":7:41 104 {*movsi_aarch64}

becomes

(insn 34 32 36 3 (set (reg:SI 103 [ _7 ])
         (subreg:SI (reg/f:DI 64 sfp) 0)) "bla.c":7:41 104 {*movsi_aarch64}
      (nil))

but aarch64_hard_regno_mode_ok doesn't like that:

   if (regno == FRAME_POINTER_REGNUM || regno == ARG_POINTER_REGNUM)
     return mode == Pmode;

and ICEs further on.

Therefore, this patch checks hard_regno_mode_ok if we substitute a hard
reg in subreg context.

Bootstrapped and regtested on x86, power10, and aarch64.
Regtested on riscv64.
I had wished Vald would have reviewed this by now.
Anyways I think this seems like a reasonable approach on fixing this issue.
Ok, but please give a few more days for others to review before
pushing the patch.
I think Vlad has been pretty head down on another IRA/LRA issue.  I'll ACK as well.

Jeff

Reply via email to