diff --git a/gcc/testsuite/gcc.c-torture/execute/pr51447.c b/gcc/testsuite/gcc.c-torture/execute/pr51447.c index 887ddb7d067..1d00953af3a 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr51447.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr51447.c @@ -14,6 +14,9 @@ int main (void) { __label__ nonlocal_lab; +#ifdef __x86_64__ + void *save = ptr; +#endif __attribute__((noinline, noclone)) void bar (void *func) { @@ -25,5 +28,8 @@ main (void) nonlocal_lab: if (ptr != &&nonlocal_lab) abort (); +#ifdef __x86_64__ + ptr = save; /* Restore the call-saved register. */ +#endif return 0; }