ldc-developers/ldc — Issue #77: LDC1 fails to compile tango.io.vfs.ZipFolder
Author: redstar
Created: 2012-02-07 06:31:58+00:00
State: open

This seems to be a new problem. Compiling tango.io.vfs.ZipFolder results in the following assertion:

ldc: /usr/include/llvm/Instructions.h:703: llvm::Type* llvm::checkGEPType(llvm::Type*): Assertion `Ty && "Invalid GetElementPtrInst indices for type!"' failed.
0 ldc 0x000000000155434f
1 ldc 0x00000000015560bc
2 libpthread.so.0 0x00007f43320f92e0
3 libc.so.6 0x00007f4330fcda55 gsignal + 53
4 libc.so.6 0x00007f4330fced55 abort + 389
5 libc.so.6 0x00007f4330fc66c5 __assert_fail + 245
6 ldc 0x0000000000934f5b
7 ldc 0x0000000000938f81 llvm::GetElementPtrInst::GetElementPtrInst(llvm::Value*, llvm::ArrayRef, unsigned int, llvm::Twine const&, llvm::BasicBlock*) + 153
8 ldc 0x0000000000938ec0 llvm::GetElementPtrInst::Create(llvm::Value*, llvm::ArrayRef, llvm::Twine const&, llvm::BasicBlock*) + 112
9 ldc 0x000000000093655a DtoGEPi(llvm::Value*, unsigned int, unsigned int, char const*, llvm::BasicBlock*) + 326
10 ldc 0x00000000009ac2b5 DtoNestedVariable(Loc, Type*, VarDeclaration*, bool) + 2684
11 ldc 0x000000000095c2f4 ThisExp::toElem(IRState*) + 258
12 ldc 0x000000000095bc7f DotVarExp::toElem(IRState*) + 365
13 ldc 0x0000000000959d39 CallExp::toElem(IRState*) + 399
14 ldc 0x000000000095eb69 AssertExp::toElem(IRState*) + 411
15 ldc 0x00000000009540b4 Expression::toElemDtor(IRState*) + 48
16 ldc 0x00000000009f8215 ExpStatement::toIR(IRState*) + 261
17 ldc 0x00000000009f792a CompoundStatement::toIR(IRState*) + 142
18 ldc 0x00000000009f8829 ScopeStatement::toIR(IRState*) + 143
19 ldc 0x00000000009f792a CompoundStatement::toIR(IRState*) + 142
20 ldc 0x00000000009b4a91 DtoDefineFunction(FuncDeclaration*) + 3604
21 ldc 0x00000000009acd48 DtoNestedContext(Loc, Dsymbol*) + 507
22 ldc 0x00000000009a1ccf DtoCallFunction(Loc&, Type*, DValue*, ArrayBase*) + 1504
23 ldc 0x000000000095a875 CallExp::toElem(IRState*) + 3275
24 ldc 0x00000000009540b4 Expression::toElemDtor(IRState*) + 48
25 ldc 0x00000000009f8215 ExpStatement::toIR(IRState*) + 261
26 ldc 0x00000000009f792a CompoundStatement::toIR(IRState*) + 142
27 ldc 0x00000000009fdb6f LabelStatement::toIR(IRState*) + 1085
28 ldc 0x00000000009f792a CompoundStatement::toIR(IRState*) + 142
29 ldc 0x00000000009b4a91 DtoDefineFunction(FuncDeclaration*) + 3604
30 ldc 0x0000000000a19799 Ir::emitFunctionBodies() + 69
31 ldc 0x0000000000947853 Module::genLLVMModule(llvm::LLVMContext&, Ir*) + 1111
32 ldc 0x0000000000a050ce main + 11387
33 libc.so.6 0x00007f4330fba09d __libc_start_main + 253
34 ldc 0x0000000000838e79

Happens with -m32 and -m64.

The method DtoGEPi is called with the parameters i0 = 0, i1 = -1 and var = "this". This causes the assertion.