Open Quuxplusone opened 10 years ago
run-rdtsc.sh
In the attached case redundant instruction "movl %eax, %eax" is generated that isn't needed. I think this is maybe because of the preceding assembly. $ sh run-rdts.sh .text .file "rdtsc.c" .globl do_rdtsc .align 16, 0x90 .type do_rdtsc,@function do_rdtsc: # @do_rdtsc .cfi_startproc # BB#0: pushq %rbp .Ltmp0: .cfi_def_cfa_offset 16 .Ltmp1: .cfi_offset %rbp, -16 movq %rsp, %rbp .Ltmp2: .cfi_def_cfa_register %rbp #APP rdtsc #NO_APP # kill: EDX<def> EDX<kill> RDX<def> shlq $32, %rdx movl %eax, %eax orq %rdx, %rax popq %rbp retq .Ltmp3: .size do_rdtsc, .Ltmp3-do_rdtsc .cfi_endproc .ident "clang version 3.6.0 (trunk 215999)" .section ".note.GNU-stack","",@progbits
Attached run-rdtsc.sh (250 bytes, text/plain): testcase
observed in rev.215999
run-rdtsc.sh
(250 bytes, text/plain)