This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/46598] [4.4/4.5/4.6 Regression] Miscompiles computed goto
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 23 Nov 2010 15:44:40 +0000
- Subject: [Bug rtl-optimization/46598] [4.4/4.5/4.6 Regression] Miscompiles computed goto
- Auto-submitted: auto-generated
- References: <bug-46598-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46598
--- Comment #16 from H.J. Lu <hjl.tools at gmail dot com> 2010-11-23 15:44:35 UTC ---
(In reply to comment #14)
> (In reply to comment #13)
> > They can use the new rdtsc builtin.
>
> In which GCC version will it appear ? will be cool if you can share a little
> example as well.
GCC 4.5 supports it:
[hjl@gnu-6 tmp]$ cat x.c
#include <x86intrin.h>
unsigned long long
foo ()
{
return __rdtsc ();
}
[hjl@gnu-6 tmp]$ gcc -O2 x.c -S
[hjl@gnu-6 tmp]$ cat x.s
.file "x.c"
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
.LFB535:
.cfi_startproc
rdtsc
salq $32, %rdx
orq %rdx, %rax
ret
.cfi_endproc
.LFE535:
.size foo, .-foo
.ident "GCC: (GNU) 4.5.1 20100924 (Red Hat 4.5.1-4)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-6 tmp]$ gcc -O2 x.c -S -m32
[hjl@gnu-6 tmp]$ cat x.s
.file "x.c"
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
pushl %ebp
movl %esp, %ebp
rdtsc
popl %ebp
ret
.size foo, .-foo
.ident "GCC: (GNU) 4.5.1 20100924 (Red Hat 4.5.1-4)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-6 tmp]$