summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/hppa/__longjmp.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 35b2d94135..16b1f2585b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-08 Helge Deller <deller@gmx.de>
+
+ [BZ #21049]
+ * sysdeps/hppa/__longjmp.c (__longjmp): Move call to CHECK_SP up
+ to avoid clobbering r26.
+
2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
[BZ #21871]
diff --git a/sysdeps/hppa/__longjmp.c b/sysdeps/hppa/__longjmp.c
index a7eefc7ad6..2fedb1d738 100644
--- a/sysdeps/hppa/__longjmp.c
+++ b/sysdeps/hppa/__longjmp.c
@@ -24,15 +24,15 @@
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 +79,7 @@ __longjmp (__jmp_buf env, int val)
: /* No outputs. */
: "r" (r25), "r" (r26)
: /* No point in clobbers. */ );
+
/* Avoid `volatile function does return' warnings. */
for (;;);
}