[PATCH] D46137: Fix an assertion of This DIE should've already been constructed when the " "definition DIE was created in " "getOrCreateSubprogramDIE
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Thu May 3 10:59:58 PDT 2018
Thanks for explaining - that sounds broadly right. Could you include a
minimal test case for this situation? You shouldn't need to involve LTO in
the test case itself - two (say, C or C++) source files compiled to IR,
llvm-link'd together & then the test case should probably be running llc on
that IR file. You can see other test cases for debug info in the
test/DebugInfo directory of LLVM's source.
On Thu, May 3, 2018 at 8:55 AM Yunlian Jiang via Phabricator <
reviews at reviews.llvm.org> wrote:
> yunlian updated this revision to Diff 145027.
> yunlian added a comment.
>
> It looks like this error comes from the mixing of LTO, debug fission and
> -fdebug-info-for-profiling.
>
> In
> DwarfCompileUnit::constructAbstractSubprogramScopeDIE, we would not run
> getOrCreateSubprogramDIE if includeMinimalInlineScopes() returns True.
>
> In DwarfUnit::applySubprogramAttributes, we would run
> DwarfUnit::applySubprogramDefinitionAttributes if
> includeMinimalInlineScopes() returns False or -fdebug-info-for-profiling is
> set.
>
> In my case, includeMinimalInlineScopes returns True and
> -fdebug-info-for-profiling is set. So it did not call
> getOrCreateSubprogramDIE
> but it calls DwarfUnit::applySubprogramDefinitionAttributes to trigger the
> assertion.
>
>
> https://reviews.llvm.org/D46137
>
> Files:
> lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
>
>
> Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
> ===================================================================
> --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
> +++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
> @@ -1007,6 +1007,6 @@
> }
>
> bool DwarfCompileUnit::includeMinimalInlineScopes() const {
> - return getCUNode()->getEmissionKind() == DICompileUnit::LineTablesOnly
> ||
> - (DD->useSplitDwarf() && !Skeleton);
> + return (getCUNode()->getEmissionKind() == DICompileUnit::LineTablesOnly
> ||
> + (DD->useSplitDwarf() && !Skeleton)) &&
> !getCUNode()->getDebugInfoForProfiling();
> }
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180503/8b9642f4/attachment.html>
More information about the llvm-commits
mailing list