[llvm-bugs] [Bug 50226] New: clang crashes in clang/lib/AST/ExprConstant.cpp:14737 Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed May 5 05:05:29 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=50226
Bug ID: 50226
Summary: clang crashes in clang/lib/AST/ExprConstant.cpp:14737
Assertion `!isValueDependent() && "Expression
evaluator can't be called on a dependent expression."'
failed
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: haoxintu at gmail.com
CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
richard-llvm at metafoo.co.uk
Hi all.
The small program emits one error then crashes. This crash only occurs in the
current trunk of clang, so I guess clang should be more friendly and exit
normally in this case?
$cat small.c
#include <emmintrin.h>
#include <stdint.h>
int8_t c_7;
void foo() {
__m128i b;
b != ((c_7 = b? : 2) ?: 0);
}
$clang small.c
small.c:6:17: error: used type '__m128i' (vector of 2 'long long' values) where
arithmetic or pointer type is required
b != ((c_7 = b? : 2) ?: 0);
~^
clang-13:
/home/haoxin/haoxin-data/dut-research/compilers/llvm-project/clang/lib/AST/ExprConstant.cpp:14737:
bool clang::Expr::EvaluateAsInt(clang::Expr::EvalResult&, const
clang::ASTContext&, clang::Expr::SideEffectsKind, bool) const: Assertion
`!isValueDependent() && "Expression evaluator can't be called on a dependent
expression."' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments:
/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all
--mrelax-relocations -disable-free -main-file-name small.c -mrelocation-model
static -mframe-pointer=all -fmath-errno -fno-rounding-math
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic
-debugger-tuning=gdb
-fcoverage-compilation-dir=/home/haoxin/haoxin-data/dut-research/CovSmith/front-end-bugs
-resource-dir
/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/lib/clang/13.0.0
-c-isystem /usr/local/include/csmith-2.3.0/ -internal-isystem
/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/lib/clang/13.0.0/include
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir=/home/haoxin/haoxin-data/dut-research/CovSmith/front-end-bugs
-ferror-limit 19 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig
-D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/small-5b6db7.o -x c small.c
1. small.c:6:29: current parser token ';'
2. small.c:4:12: parsing function body 'foo'
3. small.c:4:12: in compound statement ('{}')
#0 0x000055c1d9c2981c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x363681c)
#1 0x000055c1d9c276d4 llvm::sys::RunSignalHandlers()
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x36346d4)
#2 0x000055c1d9c27843 SignalHandler(int) Signals.cpp:0:0
#3 0x00007fe5024ce980 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#4 0x00007fe50117ffb7 raise
/build/glibc-S9d2JN/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#5 0x00007fe501181921 abort /build/glibc-S9d2JN/glibc-2.27/stdlib/abort.c:81:0
#6 0x00007fe50117148a __assert_fail_base
/build/glibc-S9d2JN/glibc-2.27/assert/assert.c:89:0
#7 0x00007fe501171502 (/lib/x86_64-linux-gnu/libc.so.6+0x30502)
#8 0x000055c1dc34b72a clang::Expr::EvaluateAsInt(clang::Expr::EvalResult&,
clang::ASTContext const&, clang::Expr::SideEffectsKind, bool) const
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x5d5872a)
#9 0x000055c1d77996fc tryGCCVectorConvertAndSplat(clang::Sema&,
clang::ActionResult<clang::Expr*, true>*, clang::ActionResult<clang::Expr*,
true>*) SemaExpr.cpp:0:0
#10 0x000055c1dbaaa84e
clang::Sema::CheckVectorOperands(clang::ActionResult<clang::Expr*, true>&,
clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, bool, bool,
bool)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54b784e)
#11 0x000055c1dbaaae8b
clang::Sema::CheckVectorCompareOperands(clang::ActionResult<clang::Expr*,
true>&, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation,
clang::BinaryOperatorKind)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54b7e8b)
#12 0x000055c1dbab341c
clang::Sema::CheckCompareOperands(clang::ActionResult<clang::Expr*, true>&,
clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation,
clang::BinaryOperatorKind)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54c041c)
#13 0x000055c1dbab5bf8 clang::Sema::CreateBuiltinBinOp(clang::SourceLocation,
clang::BinaryOperatorKind, clang::Expr*, clang::Expr*)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54c2bf8)
#14 0x000055c1dbab6f5c clang::Sema::BuildBinOp(clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54c3f5c)
#15 0x000055c1dbab7419 clang::Sema::ActOnBinOp(clang::Scope*,
clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54c4419)
#16 0x000055c1db7467e3
clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*,
true>, clang::prec::Level)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51537e3)
#17 0x000055c1db747e29
clang::Parser::ParseExpression(clang::Parser::TypeCastState)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x5154e29)
#18 0x000055c1db79dafd
clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51aaafd)
#19 0x000055c1db79a894
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::ParsedAttributesWithRange&)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51a7894)
#20 0x000055c1db79ab4c
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51a7b4c)
#21 0x000055c1db797f81 clang::Parser::ParseCompoundStatementBody(bool)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51a4f81)
#22 0x000055c1db7a041b clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51ad41b)
#23 0x000055c1db7050b4
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51120b4)
#24 0x000055c1db72694e clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x513394e)
#25 0x000055c1db701229
clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x510e229)
#26 0x000055c1db701981
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.240) Parser.cpp:0:0
#27 0x000055c1db701b70
clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x510eb70)
#28 0x000055c1db7027b9
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x510f7b9)
#29 0x000055c1db6f8d49 clang::ParseAST(clang::Sema&, bool, bool)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x5105d49)
#30 0x000055c1dab839a8 clang::CodeGenAction::ExecuteAction()
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x45909a8)
#31 0x000055c1da50beb1 clang::FrontendAction::Execute()
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x3f18eb1)
#32 0x000055c1da4a8ff2
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x3eb5ff2)
#33 0x000055c1da5d6b8a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x3fe3b8a)
#34 0x000055c1d78cbc9c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x12d8c9c)
#35 0x000055c1d78c6f99 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#36 0x000055c1d77edf87 main
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x11faf87)
#37 0x00007fe501162bf7 __libc_start_main
/build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:344:0
#38 0x000055c1d78c6b0a _start
(/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x12d3b0a)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project
e5984a3680bef22d422beaafa73bf131d7197973)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/haoxin/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin
clang-13: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/small-84b262.c
clang-13: note: diagnostic msg: /tmp/small-84b262.sh
clang-13: note: diagnostic msg:
********************
$clang -v
clang version 13.0.0 (https://github.com/llvm/llvm-project
e5984a3680bef22d422beaafa73bf131d7197973)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/haoxin/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
Thanks,
Haoxin
--
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/20210505/344ae32e/attachment-0001.html>
More information about the llvm-bugs
mailing list