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

PATCH More regrename problems for multi-reg replacements


When generating Thumb code for ARM we have two register classes for 
integer registers.  Most operations can only use the LO_REGS class, but a 
simple register-register movdi operation can use both, and since the two 
classes abut it is possible for a DImode value to exist partly in LO_REGS 
and partly in HI_REGS (since the union of the two is general regs).

Thus we had the situation where we had

	(set (reg:DI r7) (reg:DI r0))

	...

	(set (reg:DI r3) (reg:DI r7))

	(set (mem:DI xxx) (reg:DI r3))

because only LO_REGS (r0-r7) can be saved to memory.

However, the regrenumber pass was noting that r7,r8 contains the same 
value of r3,r4 and was substituting this value into the final insn in the 
above sequence.  Thus giving

	(set (reg:DI r7) (reg:DI r0))

	...

	(set (mem:DI xxx) (reg:DI r7))

But this is invalid, since r8 can't be written to memory, and tripped an 
abort when the constraints were revalidated.

The reason for the failure was that find_oldest_value_reg was not 
correctly validating a multi-reg value for full membership of the desired 
target CLASS.

Fixed with:

2004-01-14  Richard Earnshaw  <rearnsha@arm.com>

	* regrename.c (find_oldest_value_reg): If the replacement uses 
	multiple hard registers, check that all of them are in CLASS.

Built and tested on arm-elf for arm and Thumb.  One failure (in Thumb 
state) fixed.

Attachment: regrn.patch
Description: regrn.patch


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