Open Quuxplusone opened 10 years ago
Attached file_20509.txt
(5414 bytes, text/plain): backtrace
Any chance to have this fixed before the 3.5 release?
Attached test.ll
(2030 bytes, application/octet-stream): ir testcase
This is not LTO specific. The attached IR testcase crashes llc:
llc: /home/espindola/llvm/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1598: void llvm::DwarfCompileUnit::createGlobalVariableDIE(llvm::DIGlobalVariable): Assertion `GV.isGlobalVariable()' failed.
It was created with
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Should probably fail verification and be ignored rather than assert.
I just hit this with another code. Any progress?
Reproduced on the 3.5 branch.
In Rafael's testcase the CU's list of global variables is defined as
!2 = metadata !{i32 0}
which fails in createGlobalVariableDIE with
assert(GV.isGlobalVariable());
on trunk the list is just 2 = !{}.
I think this can be worked around on 3.5 by doing (as Eric suggested):
Index: lib/CodeGen/AsmPrinter/DwarfUnit.cpp
===================================================================
--- lib/CodeGen/AsmPrinter/DwarfUnit.cpp (revision 215556)
+++ lib/CodeGen/AsmPrinter/DwarfUnit.cpp (working copy)
@@ -1558,7 +1558,8 @@
if (getDIE(GV))
return;
- assert(GV.isGlobalVariable());
+ if (!GV.isGlobalVariable())
+ return;
DIScope GVContext = GV.getContext();
DIType GTy = DD->resolve(GV.getType());
file_20509.txt
(5414 bytes, text/plain)test.ll
(2030 bytes, application/octet-stream)