[llvm-bugs] [Bug 31392] New: DI Verifier doesn't catch missing type on DISubprogram

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 15 09:53:00 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31392

            Bug ID: 31392
           Summary: DI Verifier doesn't catch missing type on DISubprogram
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: dblaikie at gmail.com
                CC: aprantl at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

I've pruned the metadata down a bit, since it's small enough to be legible,
etc:

define void @_Z1fv() #0 !dbg !6 {
entry:
  ret void, !dbg !9
}

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}

!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1,
emissionKind: FullDebug)
!1 = !DIFile(filename: "simple.cpp", directory: "/tmp/dbginfo")
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{!"clang version 4.0.0 (trunk 289692) (llvm/trunk 289697)"}
!6 = distinct !DISubprogram(name: "f", unit: !0)
!7 = !DISubroutineType(types: !8)
!8 = !{null}
!9 = !DILocation(line: 2, column: 1, scope: !6)

This crashes in CodeGen attempting to create debug info - specifically trying
to access the type of the DISubprogram, since it's not present.

Adding 'type: !7' to the DISubprogram fixes this & should be needed on all
DISubprograms, I think. (arguably we could define an unspecified type as being
'void()' but I don't think the savings in space are worth cost in terms of
complexity, etc)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161215/44ab9f2f/attachment.html>


More information about the llvm-bugs mailing list