You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Please validate with TOT. r324412 and r324677 should have fixed the issue.
Thanks for the suggestion. Unfortunately, this is still seen on TOT.
With those commits, the list of local variables are sorted in DwarfCompileUnit::createScopeChildrenDIE; however, in this case the vla_expr variable is not included in that list (for some reason).
Extended Description
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::SmallVectorImplllvm::DIE*&, bool*) (/repo/llvm/build-all-clang40/bin/llc+0x1413a97)
#14 0x000000000141337a llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImplllvm::DIE*&) (/repo/llvm/build-all-clang40/bin/llc+0x141337a)
#15 0x0000000001413c9e llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImplllvm::DIE*&, bool*) (/repo/llvm/build-all-clang40/bin/llc+0x1413c9e)
#16 0x000000000141337a llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImplllvm::DIE*&) (/repo/llvm/build-all-clang40/bin/llc+0x141337a)
#17 0x0000000001413c9e llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImplllvm::DIE*&, bool*) (/repo/llvm/build-all-clang40/bin/llc+0x1413c9e)
#18 0x000000000141337a llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImplllvm::DIE*&) (/repo/llvm/build-all-clang40/bin/llc+0x141337a)
#19 0x0000000001413c9e llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImplllvm::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)
The text was updated successfully, but these errors were encountered: