]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
--wait-for-gdb=yes: gcc 4.1.2 now appears to delete do-nothing loops, so
authorJulian Seward <jseward@acm.org>
Fri, 16 Feb 2007 13:57:07 +0000 (13:57 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 16 Feb 2007 13:57:07 +0000 (13:57 +0000)
make the loop variable volatile so it can't do that.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6595

coregrind/m_main.c

index 5c5c564d346ad9e1482a89b38debfd0bec846412..b54b757fd4d0ec1e9feca70bd3e6be3c01e1469c 100644 (file)
@@ -1586,7 +1586,8 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp )
    /* Hook to delay things long enough so we can get the pid and
       attach GDB in another shell. */
    if (VG_(clo_wait_for_gdb)) {
-      Long q, iters;
+      Long iters;
+      volatile Long q;
       VG_(debugLog)(1, "main", "Wait for GDB\n");
       VG_(printf)("pid=%d, entering delay loop\n", VG_(getpid)());