]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix BZ #21049.
authorJohn David Anglin <danglin@gcc.gnu.org>
Sun, 9 Jul 2017 17:48:04 +0000 (13:48 -0400)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sun, 9 Jul 2017 17:48:04 +0000 (13:48 -0400)
ChangeLog
sysdeps/hppa/__longjmp.c

index f7fe7b946f5e5dba38ca536f3bf082fdd203e143..87aeac6446e0669895f948f320368ee8f3dbc2a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-07-09  Helge Deller  <deller@gmx.de>
+
+       [BZ #21049]
+       * sysdeps/hppa/__longjmp.c (__longjmp): Move call to CHECK_SP
+       up to avoid clobbering r26.
+
 2017-07-08  Andreas Schwab  <schwab@linux-m68k.org>
 
        * scripts/build-many-glibcs.py (Glibc.build_glibc): Also build
index a7eefc7ad6db7abc1862f6629fa09c0a702b882e..438db01473a34481f181defb0f1cdc69e9cfc4f8 100644 (file)
 void
 __longjmp (__jmp_buf env, int val)
 {
+#ifdef CHECK_SP
+  CHECK_SP (env[0].__jmp_buf.__sp);
+#endif
+
+  {
   /* We must use one of the non-callee saves registers
      for env.  */
   register unsigned long r26 asm ("r26") = (unsigned long)&env[0];
   register unsigned long r25 asm ("r25") = (unsigned long)(val == 0 ? 1 : val);
 
-#ifdef CHECK_SP
-  CHECK_SP (env[0].__jmp_buf.__sp);
-#endif
-
   asm volatile(
        /* Set return value.  */
        "copy   %0, %%r28\n\t"
@@ -79,6 +80,8 @@ __longjmp (__jmp_buf env, int val)
        : /* No outputs.  */
        : "r" (r25), "r" (r26)
        : /* No point in clobbers.  */ );
+  }
+
   /* Avoid `volatile function does return' warnings.  */
   for (;;);
 }