[LLVMbugs] [Bug 17907] New: miscompilation: %rbx is reused across cpuid

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 13 00:29:24 PST 2013


            Bug ID: 17907
           Summary: miscompilation: %rbx is reused across cpuid
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: kcc at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11531
  --> http://llvm.org/bugs/attachment.cgi?id=11531&action=edit

I have a cpuid function implemented like this: 

void __cpuid(int cpu_info[4], int info_type) {                                  
  __asm__ volatile("cpuid \n\t"                                                 
                   : "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]),   
                   : "a"(info_type));                                           

The asm constraints look correct -- they say that the instruction clobbers %rbx
However in some circumstances, the codegen doesn't seem to honor this.
This happens when I build a .cc files with locally modified AddressSanitizer.
I don't have a proper .cc example, only a .ll example:

% llc bug.ll 
        pushq   %rbx
        movq    %rsp, %rbx
        movq    128(%rbx), %rsi

Here %rbx is used right after cpuid which clobbers %rbx

So far I was not able to reproduce this bug w/o my local modification in

Any suggestion?

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/20131113/a6974895/attachment.html>

More information about the llvm-bugs mailing list