https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114513
--- Comment #1 from Di Zhao <dizhao at os dot amperecomputing.com> ---
I've debugged this a bit. From dump file 311r.sched1, the problem seems to have
something to do with floatunsdidf2. After processing this instruction, the
costs of FP_REGS became 0. (r=107 is "b")
Processing insn 31 {floatunsdidf2} (freq=69)
31: r111:DF=uns_float(r107:DI)
REG_DEAD r107:DI
Alt 0: (0) =w (1) w
op 0(r=111) new costs MEM:276 POINTER_AND_FP_REGS:345 FP_REGS:0
FP_LO_REGS:0 FP_LO8_REGS:0 GENERAL_REGS:345 STUB_REGS:345
TAILCALL_ADDR_REGS:345 W12_W15_REGS:345 W8_W11_REGS:345
op 1(r=107) new costs MEM:276 POINTER_AND_FP_REGS:345 FP_REGS:0
FP_LO_REGS:0 FP_LO8_REGS:0 GENERAL_REGS:345 STUB_REGS:345
TAILCALL_ADDR_REGS:345 W12_W15_REGS:345 W8_W11_REGS:345
Alt 1: (0) w (1) ?r
op 1(r=107) new costs GENERAL_REGS:138 STUB_REGS:138
TAILCALL_ADDR_REGS:138 W12_W15_REGS:138 W8_W11_REGS:138
Final costs after insn 31 {floatunsdidf2} (freq=69)
31: r111:DF=uns_float(r107:DI)
REG_DEAD r107:DI
op 0(r=111) MEM:276(+276) POINTER_AND_FP_REGS:345(+345) FP_REGS:0(+0)
FP_LO_REGS:0(+0) FP_LO8_REGS:0(+0) GENERAL_REGS:345(+345) STUB_REGS:345(+345)
TAILCALL_ADDR_REGS:345(+345) W12_W15_REGS:345(+345) W8_W11_REGS:345(+345)
op 1(r=107) MEM:9861(+276) POINTER_AND_FP_REGS:17631(+345)
FP_REGS:0(+0) FP_LO_REGS:0(+0) FP_LO8_REGS:0(+0) GENERAL_REGS:138(+138)
STUB_REGS:138(+138) TAILCALL_ADDR_REGS:138(+138) W12_W15_REGS:138(+138)
W8_W11_REGS:138(+138)