OSDN Git Service

Mark a variable as volatile to suppress a gcc warning.
authorDoug Kwan <dougkwan@google.com>
Wed, 29 Jun 2011 03:53:07 +0000 (20:53 -0700)
committerDoug Kwan <dougkwan@google.com>
Thu, 30 Jun 2011 00:18:33 +0000 (17:18 -0700)
Change-Id: Ic5263e2d7e52c72d35bf706d86bba2ad6548ce58

vm/compiler/Compiler.cpp

index 77cf164..c08d42d 100644 (file)
@@ -649,7 +649,12 @@ static void *compilerThreadStart(void *arg)
                 CompilerWorkOrder work = workDequeue();
                 dvmUnlockMutex(&gDvmJit.compilerLock);
 #if defined(WITH_JIT_TUNING)
-                u8 startTime = dvmGetRelativeTimeUsec();
+                /*
+                 * This is live across setjmp().  Mark it volatile to suppress
+                 * a gcc warning.  We should not need this since it is assigned
+                 * only once but gcc is not smart enough.
+                 */
+                volatile u8 startTime = dvmGetRelativeTimeUsec();
 #endif
                 /*
                  * Check whether there is a suspend request on me.  This