Multi-use register clobbering.

James E Wilson wilson@specifixinc.com
Mon Aug 16 20:05:00 GMT 2004


Gyle Yearsley wrote:
> If I define each as an individual register thus one word register can be
> defined
> as 7 registers (Four byte registers two word registers and the word itself).

Defining overlapping registers is not wise.  Just define the 4 byte 
ones, and you can get the rest by using HARD_REGNO_NREGS as DJ mentioned.

However, defining 4 one byte registers may not make gcc very happy.  gcc 
generally assumes that the general registers are all the same size, and 
that they are the same size as the word size.  When you have different 
sized registers, there is the possibility of problems occuring.

Also, you might get some stupid optimization decisions.  For instance, 
if we have to save all 4 byte regs to the stack, then gcc might do 4 
single byte stores to the stack instead of a single 4-byte store.  This 
can probably be fixed by modifying optimization passes as necessary, or 
perhaps with peepholes, but it may not be worth the trouble.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list