about summary refs log tree commit diff
path: root/sysdeps/mips/__longjmp.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2000-11-27 14:41:40 +0000
committerAndreas Jaeger <aj@suse.de>2000-11-27 14:41:40 +0000
commitf8028a97081f2cd4e24862507c04b05cf4687dc9 (patch)
tree1cda3747dd97dd162ef513a0dbbc48f68ce69960 /sysdeps/mips/__longjmp.c
parent1435536e90451b71e5d575735d1b67f1e33ee782 (diff)
downloadglibc-f8028a97081f2cd4e24862507c04b05cf4687dc9.tar.gz
glibc-f8028a97081f2cd4e24862507c04b05cf4687dc9.tar.xz
glibc-f8028a97081f2cd4e24862507c04b05cf4687dc9.zip
Update.
2000-11-25  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>

	* sysdeps/mips/__longjmp.c (__longjmp): Restore SP and FP last and
	in a single asm as they may be used to access other stored
	registers.
	* sysdeps/mips/mips64/__longjmp.c (__longjmp): Likewise.
Diffstat (limited to 'sysdeps/mips/__longjmp.c')
-rw-r--r--sysdeps/mips/__longjmp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sysdeps/mips/__longjmp.c b/sysdeps/mips/__longjmp.c
index a1920ca257..66810a51ed 100644
--- a/sysdeps/mips/__longjmp.c
+++ b/sysdeps/mips/__longjmp.c
@@ -45,16 +45,10 @@ __longjmp (env, val_arg)
   asm volatile ("l.d $f28, %0" : : "m" (env[0].__fpregs[4]));
   asm volatile ("l.d $f30, %0" : : "m" (env[0].__fpregs[5]));
 
-  /* Restore the stack pointer.  */
-  asm volatile ("lw $29, %0" : : "m" (env[0].__sp));
-
   /* Get and reconstruct the floating point csr.  */
   asm volatile ("lw $2, %0" : : "m" (env[0].__fpc_csr));
   asm volatile ("ctc1 $2, $31");
 
-  /* Get the FP.  */
-  asm volatile ("lw $30, %0" : : "m" (env[0].__fp));
-
   /* Get the GP. */
   asm volatile ("lw $gp, %0" : : "m" (env[0].__gp));
 
@@ -71,7 +65,13 @@ __longjmp (env, val_arg)
   /* Get the PC.  */
   asm volatile ("lw $25, %0" : : "m" (env[0].__pc));
 
-  /* Give setjmp 1 if given a 0, or what they gave us if non-zero.  */
+  /* Restore the stack pointer and the FP.  They have to be restored
+     last and in a single asm as gcc, depending on options used, may
+     use either of them to access env.  */
+  asm volatile ("lw $29, %0\n\t"
+		"lw $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp));
+
+/* Give setjmp 1 if given a 0, or what they gave us if non-zero.  */
   if (val == 0)
     asm volatile ("li $2, 1");
   else