ce426f
diff --git glibc-2.17-c758a686/nptl/tst-cleanup2.c glibc-2.17-c758a686/nptl/tst-cleanup2.c
ce426f
index 5bd1609..65af0f2 100644
ce426f
--- glibc-2.17-c758a686/nptl/tst-cleanup2.c
ce426f
+++ glibc-2.17-c758a686/nptl/tst-cleanup2.c
ce426f
@@ -34,6 +34,12 @@ static int
ce426f
 do_test (void)
ce426f
 {
ce426f
   char *p = NULL;
ce426f
+  /* gcc can overwrite the success written value by scheduling instructions
ce426f
+     around sprintf.  It is allowed to do this since according to C99 the first
ce426f
+     argument of sprintf is a character array and NULL is not a valid character
ce426f
+     array.  Mark the return value as volatile so that it gets reloaded on
ce426f
+     return.  */
ce426f
+  volatile int ret = 0;
ce426f
   struct sigaction sa;
ce426f
 
ce426f
   sa.sa_handler = sig_handler;
ce426f
@@ -50,7 +56,7 @@ do_test (void)
ce426f
   if (setjmp (jmpbuf))
ce426f
     {
ce426f
       puts ("Exiting main...");
ce426f
-      return 0;
ce426f
+      return ret;
ce426f
     }
ce426f
 
ce426f
   sprintf (p, "This should segv\n");