[llvm-bugs] [Bug 45166] New: Expr::EvaluateKnownConstInt fails precondition when using DWARF 5
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Mar 10 10:10:33 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=45166
Bug ID: 45166
Summary: Expr::EvaluateKnownConstInt fails precondition when
using DWARF 5
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: luismarques at lowrisc.org
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
Created attachment 23219
--> https://bugs.llvm.org/attachment.cgi?id=23219&action=edit
Clang asked me to attach this, but the bug is pretty self contained so...
A debug build of Clang crashes with the following program and invocation
options. Tested with Clang/LLVM master (commit d871ef4e6a 2020-03-10).
$ cat bug.cpp
template <int> struct b {
enum { c };
};
template <int d = 0, long = b<d>::c> struct e {};
e<> g;
$ clang++ -gdwarf-5 bug.cpp
clang-10: /home/luismarques/llvm-project/clang/lib/AST/ExprConstant.cpp:14006:
llvm::APSInt clang::Expr::EvaluateKnownConstInt(const clang::ASTContext &,
SmallVectorImpl<clang::PartialDiagnosticAt> *) const: Assertion
`!isValueDependent() && "Expression evaluator can't be called on a dependent
expression."' failed.
Stack dump:
0. Program arguments:
/home/luismarques/llvm-project/build-all/bin/clang-10 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
bug.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all
-fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining
-debug-info-kind=limited -dwarf-version=5 -debugger-tuning=gdb -resource-dir
/home/luismarques/llvm-project/build-all/lib/clang/11.0.0 -internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0
-internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/backward
-internal-isystem /usr/local/include -internal-isystem
/home/luismarques/llvm-project/build-all/lib/clang/11.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /home/luismarques/bug-split-dwarf
-ferror-limit 19 -fmessage-length 0 -fgnuc-version=4.2.1 -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-faddrsig -o /tmp/bug-19d0fd.o -x c++ bug.cpp
1. <eof> parser at end of file
2. bug.cpp:5:5: LLVM IR generation of declaration 'g'
3. bug.cpp:5:5: Generating code for declaration 'g'
#0 0x00007f1608f3bf97 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/luismarques/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:11
#1 0x00007f1608f3c159 PrintStackTraceSignalHandler(void*)
/home/luismarques/llvm-project/llvm/lib/Support/Unix/Signals.inc:625:1
#2 0x00007f1608f3a6d8 llvm::sys::RunSignalHandlers()
/home/luismarques/llvm-project/llvm/lib/Support/Signals.cpp:67:5
#3 0x00007f1608f3c9be SignalHandler(int)
/home/luismarques/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
#4 0x00007f16105fe930 __restore_rt (/usr/lib/libpthread.so.0+0x14930)
#5 0x00007f160862bf25 raise (/usr/lib/libc.so.6+0x3bf25)
#6 0x00007f1608615897 abort (/usr/lib/libc.so.6+0x25897)
#7 0x00007f1608615767 _nl_load_domain.cold (/usr/lib/libc.so.6+0x25767)
#8 0x00007f1608624526 (/usr/lib/libc.so.6+0x34526)
#9 0x00007f1605184764 clang::Expr::EvaluateKnownConstInt(clang::ASTContext
const&, llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >*) const
/home/luismarques/llvm-project/clang/lib/AST/ExprConstant.cpp:14008:14
#10 0x00007f160f340655
clang::CodeGen::CGDebugInfo::CollectTemplateParams(clang::TemplateParameterList
const*, llvm::ArrayRef<clang::TemplateArgument>, llvm::DIFile*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp:1816:42
#11 0x00007f160f33b863
clang::CodeGen::CGDebugInfo::CollectCXXTemplateParams(clang::ClassTemplateSpecializationDecl
const*, llvm::DIFile*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp:1946:10
#12 0x00007f160f3485ef
clang::CodeGen::CGDebugInfo::CreateLimitedType(clang::RecordType const*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp:3261:28
#13 0x00007f160f343a6a
clang::CodeGen::CGDebugInfo::getOrCreateLimitedType(clang::RecordType const*,
llvm::DIFile*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp:3168:26
#14 0x00007f160f34318f
clang::CodeGen::CGDebugInfo::CreateTypeDefinition(clang::RecordType const*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp:2310:26
#15 0x00007f160f343991
clang::CodeGen::CGDebugInfo::CreateType(clang::RecordType const*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp:2295:3
#16 0x00007f160f347e00
clang::CodeGen::CGDebugInfo::CreateTypeNode(clang::QualType, llvm::DIFile*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp:3107:5
#17 0x00007f160f336c74
clang::CodeGen::CGDebugInfo::getOrCreateType(clang::QualType, llvm::DIFile*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp:3027:17
#18 0x00007f160f351328
clang::CodeGen::CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable*,
clang::VarDecl const*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp:4541:9
#19 0x00007f160f76055f
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*,
bool)
/home/luismarques/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:4158:46
#20 0x00007f160f7555f3
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2884:12
#21 0x00007f160f75a1bd
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
/home/luismarques/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2584:5
#22 0x00007f160f762e6c
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
/home/luismarques/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:5316:48
#23 0x00007f160f96320f (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
/home/luismarques/llvm-project/clang/lib/CodeGen/ModuleBuilder.cpp:169:73
#24 0x00007f160f71c9b0
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
/home/luismarques/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:214:12
#25 0x00007f1603b1e403 clang::ParseAST(clang::Sema&, bool, bool)
/home/luismarques/llvm-project/clang/lib/Parse/ParseAST.cpp:162:20
#26 0x00007f160c20ead2 clang::ASTFrontendAction::ExecuteAction()
/home/luismarques/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1049:1
#27 0x00007f160f717223 clang::CodeGenAction::ExecuteAction()
/home/luismarques/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:0:28
#28 0x00007f160c20e425 clang::FrontendAction::Execute()
/home/luismarques/llvm-project/clang/lib/Frontend/FrontendAction.cpp:944:7
#29 0x00007f160c1778c9
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/luismarques/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:969:23
#30 0x00007f16105ce668
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/luismarques/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:292:8
#31 0x0000563ab77a59ee cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /home/luismarques/llvm-project/clang/tools/driver/cc1_main.cpp:240:13
#32 0x0000563ab77986a4 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
/home/luismarques/llvm-project/clang/tools/driver/driver.cpp:328:5
#33 0x0000563ab77978ea main
/home/luismarques/llvm-project/clang/tools/driver/driver.cpp:402:5
#34 0x00007f1608617153 __libc_start_main (/usr/lib/libc.so.6+0x27153)
#35 0x0000563ab779702e _start
(/home/luismarques/llvm-project/build-all/bin/clang-10+0x3902e)
clang-10: error: unable to execute command: Aborted (core dumped)
clang-10: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/luismarques/llvm-project/build-all/bin
--
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/20200310/a281f041/attachment-0001.html>
More information about the llvm-bugs
mailing list