[LLVMbugs] [Bug 3152] New: optimizers fail to fold a load from bitcast pointer to a constant global

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Dec 1 16:55:12 PST 2008


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

           Summary: optimizers fail to fold a load from bitcast pointer to a
                    constant global
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu


Testcase follows; opt -std-compile-opts doesn't know how to fold it. Not that I
really blame the LLVM optimizers, but this is the cause of a failure in the
clang regression tests, and it shouldn't be that difficult to fix.

target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i686-pc-linux-gnu"
        %struct.s0 = type <{ i8, i8, i8, i8, i8, i8, i8, i8 }>

internal constant %struct.s0 <{ i8 -17, i8 -66, i8 -17, i8 -66, i8 -83, i8 14,
i8 0, i8 0 }>            ; <%struct.s0*>:1 [#uses=1]

define i32 @g0() nounwind readonly {
entry:
        %tmp10.i = load i64* bitcast (%struct.s0* @0 to i64*), align 8
        %tmp316.i = trunc i64 %tmp10.i to i32           ; <i32> [#uses=2]
        ret i32 %tmp316.i
}


-- 
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