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: Calling convention that gets frame pointer register clobbered


Latchesar Ionkov wrote:
I am trying to port gcc (the i386 target) to an operating system. The
calling convention is an extreme caller-saves one. It does not guarantee
that any register (except the stack pointer) will be preserved.

If the stack pointer is the only preserved register, then the only place you can put the frame pointer is to push it on the stack before the call, and pop it off the stack after the call.


That is such a badly designed ABI that there doesn't seem to be much point in adding generic support for it.

You can handle this manually by modifying your call patterns to emit multiple assembler insns, or alternatively, make your call patterns into expanders that emit multiple RTL insns. You can then emit the push/pop along with the call. You will also probably have to handle some other registers the same way, the static chain pointer for instance. The pic base register if you want pic support.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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