[LLVMbugs] [Bug 20881] New: Redundant instruction injected after the rdtsc instruction

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 8 14:39:17 PDT 2014


            Bug ID: 20881
           Summary: Redundant instruction injected after the rdtsc
           Product: clang
           Version: trunk
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yuri at tsoft.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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
        .file   "rdtsc.c"
        .globl  do_rdtsc
        .align  16, 0x90
        .type   do_rdtsc, at function
do_rdtsc:                               # @do_rdtsc
# BB#0:
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset %rbp, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register %rbp
                                        # kill: EDX<def> EDX<kill> RDX<def>
        shlq    $32, %rdx
        movl    %eax, %eax
        orq     %rdx, %rax
        popq    %rbp
        .size   do_rdtsc, .Ltmp3-do_rdtsc

        .ident  "clang version 3.6.0 (trunk 215999)"
        .section        ".note.GNU-stack","", at progbits

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140908/4bedf7f0/attachment.html>

More information about the llvm-bugs mailing list