This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: causing function not to clobber
- From: Ian Lance Taylor <iant at google dot com>
- To: dmitri dot sorkin at intel dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 17 Aug 2010 07:00:08 -0700
- Subject: Re: causing function not to clobber
- References: <201008151307.51866.dmitri.sorkin@intel.com>
Dima Sorkin <dmitri.sorkin@intel.com> writes:
> Consider a function
> void f();
>
> Is there a way to specify that this function should not clobber any register (i.e. save every register it uses on the stack), even if ABI permits to clobber certain registers ?
gcc has that feature for certain targets but not for all, via a function
attribute. You didn't mention which target you are using. The feature
is not available on x86.
> If a way exists, is it in standard C (for example C99), or GCC extension ?
The feature, when supported, is a GCC extension. There is no way to
request this in standard C.
Ian