CALL_USED_REGISTERS & local_alloc

Alessandro Lonardo alessandro.lonardo@roma1.infn.it
Fri Nov 12 17:01:00 GMT 2004


James E Wilson wrote:

> 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.


Thank you for the answer.

Alessandro




More information about the Gcc mailing list