Closed
Description
Steps to reproduce:
- Build
rustc
withRUSTFLAGS_STAGE2=-g make rustc-stage2
- Try to compile a simple hello-world program with
rustc ./ltocrash.rs -g -C lto
fn main() {
println!("Hello World!");
}
- Observe that
rustc
crashes with the following error:
rustc: /home/mw/rust/src/llvm/lib/CodeGen/LexicalScopes.cpp:179: llvm::LexicalScope* llvm::LexicalScopes::getOrCreateRegularScope(llvm::MDNode*): Assertion `DISubprogram(Scope).describes(MF->getFunction())' failed.
A very similar issue (#17201) occurred in non-LTO cases.