This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: CALL_USED_REGISTERS & local_alloc
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