Register allocation and multi-reg HARD_FRAME_POINTER

Uros Bizjak ubizjak@gmail.com
Sat Jan 30 17:46:00 GMT 2010


Hello!

The target that I would like to support has 8-bit registers, so for any 
sane compilation, stack pointer, frame pointer and hard frame pointer 
all need to be constructed from at least two registers, to form 16-bit 
register pair {rA, rB}.

The stack pointer is defined as a fixed register, so it is not reachable 
to register allocator.
The frame pointer is actually a fake register (with a regnum above last 
hard register regnum) that eliminates either to SP or HW_FP, so RA 
ignores it.

The problem is with HW_FP. Looking at the register allocator, it seems 
that only HARD_FRAME_POINTER_REGNO is marked as live in the allocator, 
although hard_frame_pointer_rtx shows itself as a HImode register with 
H_F_P_R register number. Since H_F_P_R+1 is marked "empty", RA puts 
various QImode values there, clobbering high part of hard frame pointer.

There is nothing in the documentation that would describe this 
limitation, and I found no solution browsing the web archives. Also, I 
believe that AVR should have the same problems.

Is this a known limitation in the RA? If it is, is there a solution for 
multi-reg [HARD]_FRAME_POINTER?

Thanks,
Uros.



More information about the Gcc mailing list