http://llvm.org/bugs/show_bug.cgi?id=20881

            Bug ID: 20881
           Summary: Redundant instruction injected after the rdtsc
                    instruction
           Product: clang
           Version: trunk
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to