public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* callee-saved registers
@ 2010-03-02 13:11 Mathieu Lacage
  2010-03-02 15:55 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Lacage @ 2010-03-02 13:11 UTC (permalink / raw)
  To: gcc-help

hi,

I wonder if it's possible to ask gcc to generate code for a function
as if all registers were callee-saved. i.e., I would like to make sure
that my function does not touch _any_ register from the perspective of
the caller, independently from the abi calling convention. I could
write my own prologue/epilogue to save/restore all registers by hand
but it's not really a lot of fun...

Mathieu
-- 
Mathieu Lacage <mathieu.lacage@gmail.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: callee-saved registers
  2010-03-02 13:11 callee-saved registers Mathieu Lacage
@ 2010-03-02 15:55 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2010-03-02 15:55 UTC (permalink / raw)
  To: Mathieu Lacage; +Cc: gcc-help

Mathieu Lacage <mathieu.lacage@gmail.com> writes:

> I wonder if it's possible to ask gcc to generate code for a function
> as if all registers were callee-saved. i.e., I would like to make sure
> that my function does not touch _any_ register from the perspective of
> the caller, independently from the abi calling convention. I could
> write my own prologue/epilogue to save/restore all registers by hand
> but it's not really a lot of fun...

This is available on some targets via a function attribute, but it is
not available on all targets.  E.g., for MIPS targets, see the
"interrupt" function attribute.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-02 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-02 13:11 callee-saved registers Mathieu Lacage
2010-03-02 15:55 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).