This is the mail archive of the gcc@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]

Re: Problem with reloading in a new backend...


Stelian Pop wrote:
	#define PREFERRED_RELOAD_CLASS(X, CLASS)        \
	  ((CONSTANT_P(X)) ? EIGHT_REGS :               \
	   (MEM_P(X)) ? EVEN_REGS : CLASS)

	#define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \
	  ((CONSTANT_P(X)) ? EIGHT_REGS :               \
	   (MEM_P(X)) ? EVEN_REGS : CLASS)

I think most of your trouble is here. Suppose we are trying to reload a constant into an even-reg. We call PREFERRED_RELOAD_CLASS, which says to use eight_regs instead, and you get a fatal_insn error because you didn't get the even-reg that the instruction needed.


PREFERRED_RELOAD_CLASS must always return a class that is a strict subset of the class that was passed in.

So define another register class which is the intersection of eight regs and even regs, and when we call PREFERRED_RELOAD_CLASS with a constant and even regs, then return the eight/even intersection class.

Likewise in all of the other cases you are trying to handle.

Fix this problem, and you probably don't need most of the other changes you have made recently.

Jim


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