On Mon, 2019-11-25 at 16:47 -0600, Segher Boessenkool wrote: > > > > - sh (that's sh4-linux): > > > > > > /home/segher/src/kernel/net/ipv4/af_inet.c: In function > > > 'snmp_get_cpu_field': > > > /home/segher/src/kernel/net/ipv4/af_inet.c:1638:1: error: unable to find > > > a register to spill in class 'R0_REGS' > > > 1638 | } > > > | ^ > > > /home/segher/src/kernel/net/ipv4/af_inet.c:1638:1: error: this is the > > > insn: > > > (insn 18 17 19 2 (set (reg:SI 0 r0) > > > (mem:SI (plus:SI (reg:SI 4 r4 [178]) > > > (reg:SI 6 r6 [171])) [17 *_3+0 S4 A32])) > > > "/home/segher/src/kernel/net/ipv4/af_inet.c":1638:1 188 {movsi_i} > > > (expr_list:REG_DEAD (reg:SI 4 r4 [178]) > > > (expr_list:REG_DEAD (reg:SI 6 r6 [171]) > > > (nil)))) > > > /home/segher/src/kernel/net/ipv4/af_inet.c:1638: confused by earlier > > > errors, bailing out > > > > Would have to look more at this one. Seems odd that it can't allocate > > R0 when it's already the destination and when R0 can't be live before > > the insn. But there again, this is reload, so my enthuasiasm for looking > > is a bit limited :-) > > It wants to use r0 in some other insn, so it needs to spill it here, but > cannot. This is what class_likely_spilled is for. >
Hmm ... the R0 problem ... SH doesn't override class_likely_spilled explicitly, but it's got a R0_REGS class with only one said reg in it. So the default impl of class_likely_spilled should do its thing. LRA is available on SH and often fixes the R0 problems -- but not always. Maybe it got better over time, haven't checked. Could you re-run the SH build tests with -mlra, please ? Cheers, Oleg