CALL_USED_REGISTERS & local_alloc

James E Wilson wilson@specifixinc.com
Thu Nov 11 20:33:00 GMT 2004


Alessandro Lonardo wrote:
> I understand that the function_prologue/epilogue port does not have to 
> contain explicit code to perform these operations, or do they have to 
> contain it?

Your port is responsible for this.  The preferred solution is to define 
prologue/epilogue patterns in the md file that set up the frame, and 
save/restore all call saved registers, along with whatever machine 
specific support is needed.

Normally, the register allocator will use call-clobbered regs in 
preference to call-saved regs for a leaf routine, but since all of your 
call-clobbered regs are also fixed regs, there are no call-clobbered 
regs available to the register allocator.  So it has to use a call-saved 
register here, and you have to have prologue/epilogue code to 
save/restore them.

Try looking at how various ports have implemented their prologue and 
epilogue support.  There are many examples you can look at, and most of 
them use a similar implementation style.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list