From 366ed7047aa97229142d7208925b4f9d0e52842c Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 28 Mar 2009 03:26:05 +0000 Subject: [PATCH] - The variable the result of rdtsc is placed in also needs to be marked as volatile to ensure that GCC doesn't optimize the function call away. SVN r1510 (trunk) --- src/stats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stats.h b/src/stats.h index bb1deebeb9..83f5151dc0 100644 --- a/src/stats.h +++ b/src/stats.h @@ -130,7 +130,7 @@ inline volatile unsigned long long rdtsc() if (CPU.bRDTSC) #endif { - register unsigned long long tsc asm("eax"); + register unsigned volatile long long tsc asm("eax"); asm volatile ("\trdtsc\n" : : : "eax", "edx"); return tsc; }