http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60473
--- Comment #1 from Martin <marmoo1024 at gmail dot com> --- After some checking I've found that the problem is with the binary OR operator. Addition doesn't have a problem but or does. Here are my results. unsigned long long **_rdtsc_64 () { unsigned long long h,l; asm volatile ("rdtsc" : "=a" (l), "=d" (h) ); return **; } x1_rdtsc_64(): rdtsc ; return l + h*(0x100000000LLU) salq $32, %rdx addq %rdx, %rax ret x2_rdtsc_64(): rdtsc ; return l | h*(0x100000000LLU) salq $32, %rdx orq %rax, %rdx movq %rdx, %rax ret x3_rdtsc_64(): rdtsc ; return l + (h<<32) salq $32, %rdx addq %rdx, %rax ret x4_rdtsc_64(): rdtsc ; return l | (h<<32) salq $32, %rdx orq %rax, %rdx movq %rdx, %rax ret