To expand on my previous reply, I would like to configure GCC so that a callee does not need to save and restore registers that it is using other than the frame-pointer and return-pointer registers. The callee would not need to save and restore registers that it is using because it would be assumed that the caller has saved all registers that it is using. On Mon, Aug 5, 2019 at 6:19 PM William Tambe <tambewilliam@xxxxxxxxx> wrote: > > On Mon, Aug 5, 2019 at 4:53 PM Florian Weimer <fw@xxxxxxxxxxxxx> wrote: > > > > * William Tambe: > > > > > Is there a way to configure GCC so that before a function call, the > > > caller save any registers that it is using, instead of the callee > > > prologue saving registers that it is using ? > > > > How is that different from an ordinary volatile/caller-saved register? > > Do you need a way to change an existing target ABI in this way? In > > general, I think this will require patching of target code, and there > > will be some loss of functionality. > > I am working on porting GCC to a new target, and it is the behavior > that I have in mind for its ABI. > > I am not sure how different it is from an ordinary > volatile/caller-saved register, however I would like to configure GCC > so that the prologue never need to use code similar to the following > as the caller would have saved all registers that it is using: > #define MUST_SAVE_REGISTER(R) \ > !fixed_regs[R] && \ > df_regs_ever_live_p (R) && \ > !call_used_regs[R]) > > Pointers on how to implement such a behavior would be much appreciated.