This is the mail archive of the gcc-help@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: causing function not to clobber


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


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