This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CALL_USED_REGISTERS & local_alloc


James E Wilson wrote:

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.

Yes, that is the behaviour I was expecting.



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.

I do agree.
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?


Thanks,

Alessandro




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]