-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
Description
https://godbolt.org/z/Kz1rrKTdo
Reduced testcase (from a full LTO link):
define void @a() !dbg !10 {
br label %for.b.c.c, !dbg !13
for.b.c.c:
br label %for.b.c.c
}
!llvm.dbg.cu = !{!0, !6}
!llvm.module.flags = !{!8}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_20, file: !1, emissionKind: FullDebug, globals: !2)
!1 = !DIFile(filename: "foo.cpp", directory: "")
!2 = !{!3}
!3 = !DIGlobalVariableExpression(var: !4, expr: !DIExpression())
!4 = !DIGlobalVariable(type: !5)
!5 = !DICompositeType(tag: DW_TAG_class_type)
!6 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_20, file: !7, emissionKind: FullDebug)
!7 = !DIFile(filename: "bar.cpp", directory: "")
!8 = !{i32 2, !"Debug Info Version", i32 3}
!10 = distinct !DISubprogram(type: !11, unit: !6)
!11 = !DISubroutineType(types: !12)
!12 = !{}
!13 = !DILocation(scope: !14, inlinedAt: !15)
!14 = distinct !DISubprogram(unit: !6)
!15 = !DILocation(scope: !16, inlinedAt: !25)
!16 = distinct !DISubprogram(type: !11, unit: !6, declaration: !17)
!17 = !DISubprogram(scope: !5, type: !11, spFlags: DISPFlagOptimized, templateParams: !18)
!18 = !{!19}
!19 = !DITemplateTypeParameter(type: !20)
!20 = !DICompositeType(tag: DW_TAG_class_type, scope: !21)
!21 = distinct !DISubprogram(unit: !6, retainedNodes: !22)
!22 = !{!23}
!23 = !DILocalVariable(scope: !21, type: !24)
!24 = !DIBasicType()
!25 = !DILocation(scope: !21, inlinedAt: !26)
!26 = !DILocation(scope: !10)
Annoyingly, I don't have llc available in my current environment, but I can repro with clang:
clang -x ir -w -c reduce.ll -o reduce.o
llvm-dwarfdump --verify reduce.o
Verifying <source>: file format elf64-x86-64
Verifying .debug_abbrev...
Verifying .debug_info Unit Header Chain...
Verifying .debug_types Unit Header Chain...
Verifying non-dwo Units...
Verifying unit: 1 / 2, "foo.cpp"
error: invalid DIE reference 0x0000002e. Offset is in between DIEs:
0x0000002d: DW_TAG_variable [8] (0x00000029)
DW_AT_type [DW_FORM_ref4] (cu + 0x002e => {0x0000002e})
Verifying unit: 2 / 2, "bar.cpp"
Verifying dwo Units...
Verifying .debug_line...
Verifying .debug_str_offsets...
error: Aggregated error counts:
error: Invalid DIE reference occurred 1 time(s).
Errors detected.
This appears to be a recent regression within the last few days, but I haven't had a chance to bisect it yet.