This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Unsaved register?
> Date: Tue, 29 May 2001 16:21:45 -0700 (PDT)
> From: Erik Walthinsen <omega@temple-baptist.com>
> cc: <gcc-bugs@gcc.gnu.org>
>
> On 29 May 2001, Geoff Keating wrote:
>
> > Sure. Your inline asm clobbers various registers by making the
> > function call, and you haven't mentioned them.
> I thought that a function call was implicitely supposed to restore all the
> state it clobbers? It's a full C function, no asm at all. How is the
> calling code supposed to know which registers are going to be clobbered?
There is an ABI that specifies what registers a call may clobber.
> I haven't seen anything in the docs about describing to gcc what registers
> a call might clobber, how does one do that?
GCC doesn't know it's a call, all it knows is that it is some
assembler. You explain the clobbers just as for any other chunk of assembler.
--
- Geoffrey Keating <geoffk@geoffk.org>