This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
forcing gcc to save all caller saved registers
- From: Andrew Haley <aph at redhat dot com>
- To: Dietmar Maurer <dietmar at ximian dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sat, 23 Nov 2002 17:39:10 +0000 (GMT)
- Subject: forcing gcc to save all caller saved registers
- References: <1038056962.7237.16.camel@tequila>
Dietmar Maurer writes:
> Hi all,
>
> is there a way to force gcc to save/restore all caller saved registers
> in the prolog/epilog.
>
> I currently use the following code to accomplish that (on x86):
>
> a_func ()
> {
> asm("" : : : "%esi", "%edi", "%ebx");
>
> ...
> }
>
>
> That way gcc save/restores all caller saved regs and generates exception
> tables able to restore all those registers (when compiled with
> -fextections)
>
> Is there any other way to accomplish the same result?
Calling __builtin_setjmp() may do what you need.
Andrew.