Hi!
I have a problem with the register allocator:
1) can't spill
2) places addresses in data-register instead of address-register
I checked the target macros for registers (section 15.7) and
register classes (section 15.8) and I dare to say that everything is
set as it should be. But I get the following error during compiling
some libs:
../../gcc-4.2.1/gcc/libgcc2.c: In function '__addvsi3':
../../gcc-4.2.1/gcc/libgcc2.c:93: error: unable to find a register to
spill in class 'Rx_REGS'
../../gcc-4.2.1/gcc/libgcc2.c:93: error: this is the insn:
(insn 12 11 13 2 ../../gcc-4.2.1/gcc/libgcc2.c:87 (parallel [
(set (reg/v:SI 101 [ w ])
(plus:SI (reg/v:SI 105 [ b ])
(reg/v:SI 104 [ a ])))
(clobber (reg:CC 49 CONDSEL))
]) 3 {addsi3} (insn_list:REG_DEP_TRUE 6
(insn_list:REG_DEP_TRUE 7 (nil)))
(expr_list:REG_UNUSED (reg:CC 49 CONDSEL)
(nil)))
../../gcc-4.2.1/gcc/libgcc2.c:93: confused by earlier errors, bailing
out
I get the same error for int main(void) { return(42); }
main-return-42.c: In function 'main':
main-return-42.c:16: error: unable to find a register to spill in
class 'Rx_REGS'
main-return-42.c:16: error: this is the insn:
(insn 7 5 8 3 (set (reg:SI 101 [ D.1405 ])
(const_int 42 [0x2a])) 79 {movsi} (nil)
(nil))
main-return-42.c:16: confused by earlier errors, bailing out
So, this has something to do with spill an reload. Is the error
caused by my "movm" pattern:
(define_insn "mov<mode>"
[(set (match_operand:ALLMT 0 "nonimmediate_operand" "= r, r, m, r")
(match_operand:ALLMT 1 "general_operand" " <iF>, r, r, m"))]
""
"@
MV_%M0%M1\t%0, %1
MV_%M0%M1\t%0, %1
store_%M1\t%0, %1
load_%M1\t%0, %1"
[(set_attr "length" "4,4,4,4")]
)
Is the general_operand the culprit?
BTW, if I set some used registers as unused, then this error does
not happen?! But then addresses are written into data-registers
instead of address-registers.
@Rask: Are you the only one familiar with GCC's register allocator?
Thanks,
Boris