This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "gcc -O3" breaks rdtsc ??


tim612 writes:
 > 
 > I use a standard sort of macro for invoking the rdtsc instruction from my
 > C++ code, and it seems wo work fine until I turn on the "-O3" optimization
 > flag. With this flag enabled, the values returned by this macro seem to be
 > garbage.
 > 
 >     #define RDTSCLL(_x)          __asm__ __volatile__ ("rdtsc" : "=A" (_x));
 > 
 > My machine:
 >     Processor: AMD Opteron(tm) Processor 248
 >     Host type: x86_64-linux
 >     GCC version: gcc (GCC) 3.4.4 20050721 (Red Hat 3.4.4-2)
 > 
 > Any ideas?

Can you supply a test case?

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]