{"action":"created","issue":{"url":"https://api.github.com/repos/ldc-developers/ldc/issues/1032","labels_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1032/labels{/name}","comments_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1032/comments","events_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1032/events","html_url":"https://github.com/ldc-developers/ldc/issues/1032","id":102210829,"number":1032,"title":"LLVM 3.7: dmd-testsuite-debug ICE wrt. debug infos and inlined functions","user":{"login":"kinke","id":1889215,"avatar_url":"https://avatars.githubusercontent.com/u/1889215?v=3","gravatar_id":"","url":"https://api.github.com/users/kinke","html_url":"https://github.com/kinke","followers_url":"https://api.github.com/users/kinke/followers","following_url":"https://api.github.com/users/kinke/following{/other_user}","gists_url":"https://api.github.com/users/kinke/gists{/gist_id}","starred_url":"https://api.github.com/users/kinke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinke/subscriptions","organizations_url":"https://api.github.com/users/kinke/orgs","repos_url":"https://api.github.com/users/kinke/repos","events_url":"https://api.github.com/users/kinke/events{/privacy}","received_events_url":"https://api.github.com/users/kinke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-08-20T19:06:21Z","updated_at":"2015-09-25T18:37:08Z","closed_at":null,"body":"`runnable/opover2.d` fails if and only if using both `-inline` and `-g` (`-O` doesn't matter), on both Win64 and Linux x64:\r\n```\r\nldc2: /home/martin/llvm/lib/CodeGen/LexicalScopes.cpp:160: llvm::LexicalScope* llvm::LexicalScopes::getOrCreateRegularScope(const llvm::DILocalScope*): Assertion `cast<DISubprogram>(Scope)->describes(MF->getFunction())' failed.\r\n#0 0x204293a llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/martin/llvm/lib/Support/Unix/Signals.inc:437:0\r\n#1 0x2042c4f PrintStackTraceSignalHandler(void*) /home/martin/llvm/lib/Support/Unix/Signals.inc:495:0\r\n#2 0x204181a SignalHandler(int) /home/martin/llvm/lib/Support/Unix/Signals.inc:210:0\r\n#3 0x7fdad5a00340 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)\r\n#4 0x7fdad4a24cc9 gsignal /build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0\r\n#5 0x7fdad4a280d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0\r\n#6 0x7fdad4a1db86 __assert_fail_base /build/buildd/eglibc-2.19/assert/assert.c:92:0\r\n#7 0x7fdad4a1dc32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)\r\n#8 0x1549cd3 llvm::LexicalScopes::getOrCreateRegularScope(llvm::DILocalScope const*) /home/martin/llvm/lib/CodeGen/LexicalScopes.cpp:161:0\r\n#9 0x1549afc llvm::LexicalScopes::getOrCreateLexicalScope(llvm::DILocalScope const*, llvm::DILocation const*) /home/martin/llvm/lib/CodeGen/LexicalScopes.cpp:138:0\r\n#10 0x154acc2 llvm::LexicalScopes::getOrCreateLexicalScope(llvm::DILocation const*) /home/martin/llvm/include/llvm/CodeGen/LexicalScopes.h:209:0\r\n#11 0x154994a llvm::LexicalScopes::extractLexicalScopes(llvm::SmallVectorImpl<std::pair<llvm::MachineInstr const*, llvm::MachineInstr const*> >&, llvm::DenseMap<llvm::MachineInstr const*, llvm::LexicalScope*, llvm::DenseMapInfo<llvm::MachineInstr const*>, llvm::detail::DenseMapPair<llvm::MachineInstr const*, llvm::LexicalScope*> >&) /home/martin/llvm/lib/CodeGen/LexicalScopes.cpp:102:0\r\n#12 0x1549699 llvm::LexicalScopes::initialize(llvm::MachineFunction const&) /home/martin/llvm/lib/CodeGen/LexicalScopes.cpp:46:0\r\n#13 0x148854a llvm::DwarfDebug::beginFunction(llvm::MachineFunction const*) /home/martin/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1089:0\r\n#14 0x146779b llvm::AsmPrinter::EmitFunctionHeader() /home/martin/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:579:0\r\n#15 0x14688ed llvm::AsmPrinter::EmitFunctionBody() /home/martin/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:788:0\r\n#16 0x10b372e llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) /home/martin/llvm/lib/Target/X86/X86AsmPrinter.cpp:70:0\r\n#17 0x15815fb llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/martin/llvm/lib/CodeGen/MachineFunctionPass.cpp:41:0\r\n#18 0x1f47ad2 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/martin/llvm/lib/IR/LegacyPassManager.cpp:1520:0\r\n#19 0x1f47c4f llvm::FPPassManager::runOnModule(llvm::Module&) /home/martin/llvm/lib/IR/LegacyPassManager.cpp:1540:0\r\n#20 0x1f47fa5 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/martin/llvm/lib/IR/LegacyPassManager.cpp:1596:0\r\n#21 0x1f48669 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/martin/llvm/lib/IR/LegacyPassManager.cpp:1698:0\r\n#22 0x1f488a3 llvm::legacy::PassManager::run(llvm::Module&) /home/martin/llvm/lib/IR/LegacyPassManager.cpp:1730:0\r\n#23 0xc617b6 codegenModule(llvm::TargetMachine&, llvm::Module&, llvm::raw_fd_ostream&, llvm::TargetMachine::CodeGenFileType) /home/martin/ldc/driver/toobj.cpp:130:0\r\n#24 0xc6333e writeModule(llvm::Module*, std::string) /home/martin/ldc/driver/toobj.cpp:568:0\r\n#25 0xc5a19c ldc::CodeGenerator::writeAndFreeLLModule(char const*) /home/martin/ldc/driver/codegenerator.cpp:171:0\r\n#26 0xc59fbb ldc::CodeGenerator::finishLLModule(Module*) /home/martin/ldc/driver/codegenerator.cpp:144:0\r\n#27 0xc5a455 ldc::CodeGenerator::emit(Module*) /home/martin/ldc/driver/codegenerator.cpp:217:0\r\n#28 0xc6e87f main /home/martin/ldc/driver/main.cpp:1298:0\r\n#29 0x7fdad4a0fec5 __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:321:0\r\n#30 0xc43df9 _start (/home/martin/build-ldc/bin/ldc2+0xc43df9)\r\n```\r\n\r\nThat's the only dmd-testsuite issue with LLVM 3.7 on Linux x64 btw."},"comment":{"url":"https://api.github.com/repos/ldc-developers/ldc/issues/comments/143317338","html_url":"https://github.com/ldc-developers/ldc/issues/1032#issuecomment-143317338","issue_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1032","id":143317338,"user":{"login":"klickverbot","id":19335,"avatar_url":"https://avatars.githubusercontent.com/u/19335?v=3","gravatar_id":"","url":"https://api.github.com/users/klickverbot","html_url":"https://github.com/klickverbot","followers_url":"https://api.github.com/users/klickverbot/followers","following_url":"https://api.github.com/users/klickverbot/following{/other_user}","gists_url":"https://api.github.com/users/klickverbot/gists{/gist_id}","starred_url":"https://api.github.com/users/klickverbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klickverbot/subscriptions","organizations_url":"https://api.github.com/users/klickverbot/orgs","repos_url":"https://api.github.com/users/klickverbot/repos","events_url":"https://api.github.com/users/klickverbot/events{/privacy}","received_events_url":"https://api.github.com/users/klickverbot/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T18:37:08Z","updated_at":"2015-09-25T18:37:08Z","body":"So here is the point where I realize that we must have been talking past each other, because I mentioned that as a possible source of the problem back in https://github.com/ldc-developers/ldc/issues/1032#issuecomment-133127002. ;)\r\n\r\nThe functions do not take a special route through the backend (well, only in the sense that `visit(StructDeclaration*)` explicitly recurses into them), but DMD does not emit any location info for the statements. We might need to detect this sort of missing location info in `EmitDwarfStopPoint` and e.g. fall back to the function start."}}