From d153ca687cf4bd97bc3458ec001ca4fe1bc611fe Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 19 Mar 1996 19:51:41 +0000 Subject: [PATCH] Wed Feb 14 00:21:17 1996 David Mosberger-Tang * sysdeps/alpha/__longjmp.c (__longjmp): moved dummy while loop to end of function to avoid a jump across NOPs. --- sysdeps/alpha/__longjmp.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sysdeps/alpha/__longjmp.c b/sysdeps/alpha/__longjmp.c index f3f35eec9c..65b6804bd3 100644 --- a/sysdeps/alpha/__longjmp.c +++ b/sysdeps/alpha/__longjmp.c @@ -38,6 +38,8 @@ register double void __longjmp (__jmp_buf env, int val) { + register long int retval asm ("$0"); + /* Restore the integer registers. */ r9 = env[0].__9; r10 = env[0].__10; @@ -73,18 +75,18 @@ __longjmp (__jmp_buf env, int val) precisely the FP and SP the desired environment needs, we must avoid the compiler doing anything with the stack. */ + + asm volatile + ("cmoveq %1, 1, %0\n\t" /* $0 = val ?: 1; */ + "ret $31, (%2), 1" /* return $0 */ + : "=r" (retval) + /* The "0" constraint should force VAL into $0. */ + : "0" (val), "r" (retpc)); + while (1) { /* The loop is just to avoid `volatile function does return' warnings. The instruction will only be executed once. */ - - register long int retval asm ("$0"); - - asm volatile - ("cmoveq %1, 1, %0\n\t" /* $0 = val ?: 1; */ - "ret $31, (%2), 1" /* return $0 */ - : "=r" (retval) - /* The "0" constraint should force VAL into $0. */ - : "0" (val), "r" (retpc)); + asm volatile (""); } }