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