[LLVMbugs] [Bug 10605] New: Or of load miscompiled at -O0

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Aug 7 18:20:52 PDT 2011


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

           Summary: Or of load miscompiled at -O0
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: peter at pcc.me.uk
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=7033)
 --> (http://llvm.org/bugs/attachment.cgi?id=7033)
Testcase

The attached bitcode file (the function llvm::BitstreamCursor::Read(unsigned
int) as compiled by dragonegg) is miscompiled at -O0.  Specifically, on an
amd64 platform, this instruction:

%72 = or i32 %71, %30

is compiled to:

orl     16(%rax), %edi

i.e. a load-or of the loaded operand, %30:

%29 = getelementptr inbounds %struct.BitstreamCursor* %1, i32 0, i32 2
%30 = load i32* %29, align 4

But this is wrong because a value is stored here later in the same basic block:

%56 = getelementptr inbounds %struct.BitstreamCursor* %1, i32 0, i32 2
store i32 %55, i32* %56, align 4

I bisected this to r130018.  .ll and "llc -O0" output attached.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list