Reloading and Spilling problem

umar janjua umarj@enabtech.com
Wed Jun 19 22:46:00 GMT 2002


> In an effort to port gcc to a dummy architecture with  sixteen data
> registers, we come across a case where gcc allocates all the data
> registers and cannot find further data registers. At this point, gcc
> should spill one of the data register to stack and proceed further.
> However , in our case the gcc is unable to find the data register to
> spill. I have already defined 
> 	#define CLASS_LIKELY_SPILLED_P(class) (( class == DATA_REGS )? 1 :0
> )
> But it seems to be not working.
> 
> 
> I have also defined reload_in and reload_out patterns that work fine 
> 
> (define_expand "reload_inqi"
> [(parallel[(match_operand:QI 0 "register_operand" "=a")
> 	     (match_operand:QI 1 "memory_operand" "m")
> 	     (match_operand:QI 2 "general_operand" "=&d")])]
> ""
> "{
> 	emit_insn(gen_movqi(operands[2],operands[1]));
> 	emit_insn(gen_movqi(operands[0],operands[2]));
> 	DONE;
> 
> }")
> 
> 
> 
> (define_expand "reload_outqi"
> [(parallel[(match_operand:QI 0 "memory_operand" "=m")
> 	     (match_operand:QI 1 "register_operand" "a")
> 	     (match_operand:QI 2 "general_operand" "=&d")])]
> ""
> "{
> 	emit_insn(gen_movqi(operands[2],operands[1]));
> 	emit_insn(gen_movqi(operands[0],operands[2]));
> 	DONE;
> 
> }")
> 
> How do i tell gcc that it should spill data register on to the stack ?  



More information about the Gcc-help mailing list