This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Reloading and Spilling problem


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 ?  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]