This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: callee-saved registers
- From: Ian Lance Taylor <iant at google dot com>
- To: Mathieu Lacage <mathieu dot lacage at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 02 Mar 2010 07:55:12 -0800
- Subject: Re: callee-saved registers
- References: <74fef6df1003020511i619ef6eesf1074583a5b761a@mail.gmail.com>
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