This is the mail archive of the gcc@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]

forcing gcc to save all caller saved registers


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.


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