[llvm-bugs] [Bug 36263] New: Assertion `CountVarDIE && "DIE for count is not yet instantiated"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 7 03:53:08 PST 2018


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

            Bug ID: 36263
           Summary: Assertion `CountVarDIE && "DIE for count is not yet
                    instantiated"' failed.
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: david.stenberg at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19823
  --> https://bugs.llvm.org/attachment.cgi?id=19823&action=edit
IR reproducer.

Seen on trunk (rL324422).

When compiling the attached IR file using:

  llc -O0 -filetype=asm -mtriple x86_64-unknown-linux-gnu -mcpu=x86-64 -o
./foo.s ./foo.opt.ll

the following crash is seen:

  llc: ../lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1355: void
llvm::DwarfUnit::constructSubrangeDIE(llvm::DIE &, const llvm::DISubrange *,
llvm::DIE *): Assertion `CountVarDIE && "DIE for count is not yet
instantiated"' failed.
  #0 0x0000000001d744f4 PrintStackTraceSignalHandler(void*)
(/repo/llvm/build-all-clang40/bin/llc+0x1d744f4)
  #1 0x0000000001d74836 SignalHandler(int)
(/repo/llvm/build-all-clang40/bin/llc+0x1d74836)
  #2 0x00007fdfdb120850 __restore_rt (/lib64/libpthread.so.0+0xf850)
  #3 0x00007fdfda2cb875 __GI_raise (/lib64/libc.so.6+0x32875)
  #4 0x00007fdfda2cce51 __GI_abort (/lib64/libc.so.6+0x33e51)
  #5 0x00007fdfda2c4740 __GI___assert_fail (/lib64/libc.so.6+0x2b740)
  #6 0x00000000013e7249 (/repo/llvm/build-all-clang40/bin/llc+0x13e7249)
  #7 0x00000000013e53d1 llvm::DwarfUnit::constructArrayTypeDIE(llvm::DIE&,
llvm::DICompositeType const*) (/repo/llvm/build-all-clang40/bin/llc+0x13e53d1)
  #8 0x00000000013e4400 llvm::DwarfUnit::constructTypeDIE(llvm::DIE&,
llvm::DICompositeType const*) (/repo/llvm/build-all-clang40/bin/llc+0x13e4400)
  #9 0x00000000013e345d llvm::DwarfUnit::getOrCreateTypeDIE(llvm::MDNode
const*) (/repo/llvm/build-all-clang40/bin/llc+0x13e345d)
  #10 0x00000000013e312c llvm::DwarfUnit::addType(llvm::DIE&, llvm::DIType
const*, llvm::dwarf::Attribute)
(/repo/llvm/build-all-clang40/bin/llc+0x13e312c)
  #11 0x0000000001414d71
llvm::DwarfCompileUnit::applyVariableAttributes(llvm::DbgVariable const&,
llvm::DIE&) (/repo/llvm/build-all-clang40/bin/llc+0x1414d71)
  #12 0x0000000001414758
llvm::DwarfCompileUnit::constructVariableDIEImpl(llvm::DbgVariable const&,
bool) (/repo/llvm/build-all-clang40/bin/llc+0x1414758)
  #13 0x0000000001413a97
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*)
(/repo/llvm/build-all-clang40/bin/llc+0x1413a97)
  #14 0x000000000141337a
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&)
(/repo/llvm/build-all-clang40/bin/llc+0x141337a)
  #15 0x0000000001413c9e
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*)
(/repo/llvm/build-all-clang40/bin/llc+0x1413c9e)
  #16 0x000000000141337a
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&)
(/repo/llvm/build-all-clang40/bin/llc+0x141337a)
  #17 0x0000000001413c9e
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*)
(/repo/llvm/build-all-clang40/bin/llc+0x1413c9e)
  #18 0x000000000141337a
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&)
(/repo/llvm/build-all-clang40/bin/llc+0x141337a)
  #19 0x0000000001413c9e
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*)
(/repo/llvm/build-all-clang40/bin/llc+0x1413c9e)
  #20 0x0000000001415ce7
llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE(llvm::LexicalScope*)
(/repo/llvm/build-all-clang40/bin/llc+0x1415ce7)

The IR file was generated by running the following commands on the attached C
file:

  clang -mllvm -disable-llvm-optzns -S -emit-llvm
--target=x86_64-unknown-linux-gnu -g foo.c -o ./foo.ll
  opt -mcpu=x86-64 -always-inline -O1 -S -o ./foo.opt.ll ./foo.ll

I'm not very knowledgeable about LLVM's inner working for this, but I noted
that the vla_expr variable is not included in the list of local variables for
the scope when running createScopeChildrenDIE(), whereas it is that in the
input IR file:

!21 = distinct !DILexicalBlock(scope: !18, file: !1, line: 5, column: 31)
!22 = !DILocalVariable(name: "vla_expr", scope: !21, file: !1, line: 6, type:
!23)
!25 = !DILocalVariable(name: "vn", scope: !21, file: !1, line: 6, type: !26)
!26 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, elements: !27)
!27 = !{!28}
!28 = !DISubrange(count: !22)

-- 
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/20180207/f723556f/attachment-0001.html>


More information about the llvm-bugs mailing list