[LLVMbugs] [Bug 9851] New: llc -combiner-alias-analysis reorders volatiles

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 5 11:43:21 PDT 2011


           Summary: llc -combiner-alias-analysis reorders volatiles
           Product: new-bugs
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: hausen at gmx.at
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=6546)
 --> (http://llvm.org/bugs/attachment.cgi?id=6546)
Test case for reordering of volatiles.

llc reorders accesses to volatiles if -combiner-alias-analysis is enabled,
although volatiles should not be reordered with regard to each other.

Testcase, which miscompiles at least for sparc and ppc32:
define i32 @test() {
  %X = volatile load i32* inttoptr(i32 8 to i32*)
  %Y = volatile load i32* inttoptr(i32 12 to i32*)
  %Z = add i32 %Y, 1000
  ret i32 %Z

Correct code, from llc -march=ppc32
  lwz 3, 8(0)
  lwz 3, 12(0)
  addi 3, 3, 1000

Miscompiled code, from llc -march=ppc32 -combiner-alias-analysis
  lwz 3, 12(0)
  lwz 4, 8(0)
  addi 3, 3, 1000

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