Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE with std.datetime.benchmark #982

Closed
John-Colvin opened this issue Jun 23, 2015 · 2 comments
Closed

ICE with std.datetime.benchmark #982

John-Colvin opened this issue Jun 23, 2015 · 2 comments

Comments

@John-Colvin
Copy link
Contributor

dustmite reduced to

import std.datetime;
void main() {
    auto r = cast(Duration[2])benchmark!({},{})(1);
}

backtrace:

Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"), function init, file /tmp/llvm20150530-30138-1918576/llvm-3.6.1.src/lib/IR/Instructions.cpp, line 281.
0  ldc2                     0x0000000104cf0bd1 llvm::sys::PrintStackTrace(__sFILE*) + 57
1  ldc2                     0x0000000104cf1127 SignalHandler(int) + 217
2  libsystem_platform.dylib 0x00007fff95a51f1a _sigtramp + 26
3  ldc2                     0x00000001054d045f FirstTarget + 67543
4  ldc2                     0x0000000104cf0fb6 abort + 22
5  ldc2                     0x0000000104cf0fa0 abort + 0
6  ldc2                     0x0000000104b9e0f0 llvm::CallInst::init(llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&) + 338
7  ldc2                     0x0000000103e2926b llvm::CallInst::CallInst(llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::Instruction*) + 267
8  ldc2                     0x0000000103e2914d llvm::CallInst::CallInst(llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::Instruction*) + 61
9  ldc2                     0x0000000103e29078 llvm::CallInst::Create(llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::Instruction*) + 136
10 ldc2                     0x0000000103e2bf2d llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >::CreateCall(llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&) + 109
11 ldc2                     0x0000000103d91962 llvm::CallSite IRState::CreateCallOrInvoke<std::__1::vector<llvm::Value*, std::__1::allocator<llvm::Value*> > >(llvm::Value*, std::__1::vector<llvm::Value*, std::__1::allocator<llvm::Value*> > const&, char const*) + 946
12 ldc2                     0x0000000103e90dfb DtoCallFunction(Loc&, Type*, DValue*, Array<Expression*>*, llvm::Value*) + 8411
13 ldc2                     0x0000000103e0e093 DtoVarDeclaration(VarDeclaration*) + 1875
14 ldc2                     0x0000000103e0e477 DtoDeclarationExp(Dsymbol*) + 423
15 ldc2                     0x0000000103eab5b2 ToElemVisitor::visit(DeclarationExp*) + 130
16 ldc2                     0x0000000103c73181 DeclarationExp::accept(Visitor*) + 33
17 ldc2                     0x0000000103ea2014 toElem(Expression*) + 68
18 ldc2                     0x0000000103ea2414 toElemDtor(Expression*) + 996
19 ldc2                     0x0000000103e6e45b ToIRVisitor::visit(ExpStatement*) + 283
20 ldc2                     0x0000000103d52d5e ExpStatement::accept(Visitor*) + 30
21 ldc2                     0x0000000103e6e580 ToIRVisitor::visit(CompoundStatement*) + 208
22 ldc2                     0x0000000103d52efe CompoundStatement::accept(Visitor*) + 30
23 ldc2                     0x0000000103e6df42 Statement_toIR(Statement*, IRState*) + 66
24 ldc2                     0x0000000103e6dec0 codegenFunction(Statement*, IRState*) + 96
25 ldc2                     0x0000000103dfe18c DtoDefineFunction(FuncDeclaration*) + 8380
26 ldc2                     0x0000000103de8615 CodegenVisitor::visit(FuncDeclaration*) + 53
27 ldc2                     0x0000000103c8aa11 FuncDeclaration::accept(Visitor*) + 33
28 ldc2                     0x0000000103de60d4 Declaration_codegen(Dsymbol*) + 68
29 ldc2                     0x0000000103e1e58e codegenModule(Module*) + 190
30 ldc2                     0x0000000103e1d2bf Module::genLLVMModule(llvm::LLVMContext&) + 1471
31 ldc2                     0x0000000103bad694 main + 8356
32 libdyld.dylib            0x00007fff8de1c5c9 start + 1
33 libdyld.dylib            0x0000000000000002 start + 1914583610
Illegal instruction: 4
@redstar
Copy link
Member

redstar commented Jun 25, 2015

Confirmed. Results in Call parameter type does not match function signature with ldc master.

@redstar
Copy link
Member

redstar commented Jun 25, 2015

Function signature is

[2 x %core.time.TickDuration]*, i32

but parameter types are

[2 x %core.time.Duration]*, i32

dnadlinger added a commit to dnadlinger/ldc that referenced this issue Aug 21, 2015
Another one caused by special "context-specific" AST semantics. :/

GitHub: Fixes ldc-developers#982.
dnadlinger added a commit to dnadlinger/ldc that referenced this issue Aug 21, 2015
Another one caused by special "context-specific" AST semantics. :/

GitHub: Fixes ldc-developers#982.
redstar pushed a commit to redstar/ldc that referenced this issue Aug 22, 2015
Another one caused by special "context-specific" AST semantics. :/

GitHub: Fixes ldc-developers#982.
(cherry picked from commit 47bd4c5)
redstar added a commit that referenced this issue Aug 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants