CALL_USED_REGISTERS & local_alloc

James E Wilson wilson@specifixinc.com
Wed Nov 10 03:37:00 GMT 2004


Alessandro Lonardo wrote:
> I defined CALL_USED_REGISTERS = FIXED_REGISTERS including all the stack 
> related regs
> along with some regs reserved for relevant constants.

So you are saying that only the fixed registers are call-used?  That 
means all other registers are call-saved, i.e. if a function uses them, 
then it must save the old value on the stack in the function prologue, 
and restore this value from the stack in the function epilogue.

> It happens that one of the two reloads in v_inc get assigned the same 
> (26) registers of i_0 which is therefore clobbered by function call.

But r26 is call-saved, so it is ok to use it across a function call. 
The problem here is that the function v_inc did not save/restore it in 
the prologue/epilogue.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list