Skip to content

Debuginfo generation is broken with LLVM 3.8 #36774

Closed
@nagisa

Description

@nagisa

Compiling librustc_mir with optimisations on and debuginfo enabled fails with LLVM assertion:

piece is larger than or outside of variable
  call void @llvm.dbg.declare(metadata %"13.rustc::mir::visit::LvalueContext"* %arg1.sroa.2, metadata !24020, metadata !43416), !dbg !46046
!24020 = !DILocalVariable(arg: 4, scope: !24006, file: !1194, line: 1, type: !"{struct rustc/599ae68a7dffd6c9bf8d7a7e26afb91619ab5f582f32707f1893ef9e2fd1fdbd/94b2}")
!43416 = !DIExpression(DW_OP_bit_piece, 64, 192)
piece is larger than or outside of variable
  call void @llvm.dbg.declare(metadata %"13.rustc::mir::repr::Location"* %arg1.sroa.3, metadata !24020, metadata !46047), !dbg !46046
!24020 = !DILocalVariable(arg: 4, scope: !24006, file: !1194, line: 1, type: !"{struct rustc/599ae68a7dffd6c9bf8d7a7e26afb91619ab5f582f32707f1893ef9e2fd1fdbd/94b2}")
!46047 = !DIExpression(DW_OP_bit_piece, 256, 128)
LLVM ERROR: Broken module found, compilation aborted!

The failure started happening sometime in the past month. Any change related to how we generate debuginfo for variables is a suspect as it likely specifies the size of the variable incorrectly (as per https://llvm.org/bugs/show_bug.cgi?id=23712)

Works fine with LLVM bundled with rust.

Metadata

Metadata

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions