Skip to content

rustc with LLVM 5 reports invalid DIExpression #47464

Closed
@cuviper

Description

@cuviper

This is a known problem from #43370, but I feel it deserves its own issue. When using rustc compiled with LLVM 5.0.1, compiling with debuginfo often prints "invalid expression" messages to stderr, and AFAICT affected functions don't get any debuginfo written at all. For example:

$ cat foo.rs
fn main() {
    (0..10).for_each(|i| println!("{}", i));
}

$ rustc -g foo.rs
invalid expression
!40 = !DIExpression(6, 34, 0)

Previous analysis in #43370 tied it to this declare_local call, and @eddyb offered a possible solution in #43370 (comment).

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions