[LLVMbugs] [Bug 6198] New: instcombine crash: "Cannot getTypeInfo() on a type that is unsized!"

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Feb 1 08:57:10 PST 2010


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

           Summary: instcombine crash: "Cannot getTypeInfo() on a type that
                    is unsized!"
           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: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


The type in question is a function type.

$ opt -instcombine -disable-output 20080721-1.ll
opt: llvm/lib/Target/TargetData.cpp:498: unsigned char
llvm::TargetData::getAlignment(const llvm::Type*, bool) const: Assertion
`Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"' failed.
...
6  opt       0x0000000000a658d8 llvm::TargetData::getAlignment(llvm::Type
const*, bool) const + 140
7  opt       0x0000000000a65b58
llvm::TargetData::getPrefTypeAlignment(llvm::Type const*) const + 40
8  opt       0x0000000000940cf7 llvm::isSafeToLoadUnconditionally(llvm::Value*,
llvm::Instruction*, unsigned int, llvm::TargetData const*) + 340


Testcase:

target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-unknown-linux-gnu"

module asm "\09.ident\09\22GCC: (GNU) 4.5.0 20100129 (experimental) LLVM:
88902:94980M\22"

define i32 @test(i32 %b) nounwind readonly {
entry:
  %0 = icmp eq i32 %b, 0                          ; <i1> [#uses=1]
  %p_1 = select i1 %0, i8* bitcast (void ()* @bar to i8*), i8* bitcast (void
()* @foo to i8*) ; <i8*> [#uses=1]
  %q_6 = bitcast i8* %p_1 to i8**                 ; <i8**> [#uses=1]
  %D.2728_7 = load i8** %q_6, align 8             ; <i8*> [#uses=1]
  %1 = icmp eq i8* %D.2728_7, null                ; <i1> [#uses=1]
  %D.2731_2 = select i1 %1, i32 1, i32 0          ; <i32> [#uses=1]
  ret i32 %D.2731_2
}

declare void @foo()

declare void @bar()


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