[llvm-bugs] [Bug 50891] New: ICE: EvaluateInteger(const clang::Expr*, llvm::APSInt&, {anonymous}::EvalInfo&): Assertion `!E->isValueDependent()' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 26 13:30:18 PDT 2021


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

            Bug ID: 50891
           Summary: ICE: EvaluateInteger(const clang::Expr*,
                    llvm::APSInt&, {anonymous}::EvalInfo&): Assertion
                    `!E->isValueDependent()' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cnsun at uwaterloo.ca
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

$ clang-trunk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
2e9c75daffddd65e37c3236708b5b133e6f5f2f5)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$ cat mutant.c
foo() {
  1 + ({
    int y;
    switch (x)
      ;
    y;
  });
}

$ clang-trunk  mutant.c
mutant.c:1:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
foo() {
^
mutant.c:4:13: error: use of undeclared identifier 'x'
    switch (x)
            ^
mutant.c:2:5: warning: expression result unused [-Wunused-value]
  1 + ({
  ~ ^ ~~
clang-13:
/tmp/tmp.xjN6dMkdrg-clang-builder/llvm-project/clang/lib/AST/ExprConstant.cpp:10825:
bool EvaluateInteger(const clang::Expr*, llvm::APSInt&,
{anonymous}::EvalInfo&): Assertion `!E->isValueDependent()' 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: /scratch/software/clang-trunk/bin/clang-13 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations
-disable-free -main-file-name mutant.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=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210623_052958_00b2/delta/perses_result
-resource-dir /scratch/software/clang-trunk/lib/clang/13.0.0 -c-isystem .
-c-isystem /usr/local/include/cmsith -internal-isystem
/scratch/software/clang-trunk/lib/clang/13.0.0/include -internal-isystem
/usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../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=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210623_052958_00b2/delta/perses_result
-ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1
-o /tmp/mutant-61f898.o -x c mutant.c
1.      mutant.c:8:1: current parser token '}'
2.      mutant.c:1:7: parsing function body 'foo'
3.      mutant.c:1:7: in compound statement ('{}')
 #0 0x00005559eeb1b184 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00005559eeb1893e SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fe9a9a7c3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #3 0x00007fe9a951b18b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007fe9a94fa859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00007fe9a94fa729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #6 0x00007fe9a94fa729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #7 0x00007fe9a950bf36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x00005559f1c26e59 (/scratch/software/clang-trunk/bin/clang-13+0x6a66e59)
 #9 0x00005559f1c28f2f EvaluateStmt((anonymous namespace)::StmtResult&,
(anonymous namespace)::EvalInfo&, clang::Stmt const*, clang::SwitchCase const*)
(.part.0) ExprConstant.cpp:0:0
#10 0x00005559f1c2450b clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous
namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*)
ExprConstant.cpp:0:0
#11 0x00005559f1c135ae Evaluate(clang::APValue&, (anonymous
namespace)::EvalInfo&, clang::Expr const*) ExprConstant.cpp:0:0
#12 0x00005559f1c154df (anonymous
namespace)::DataRecursiveIntBinOpEvaluator::process((anonymous
namespace)::DataRecursiveIntBinOpEvaluator::EvalResult&) ExprConstant.cpp:0:0
#13 0x00005559f1c67873 (anonymous
namespace)::IntExprEvaluator::VisitBinaryOperator(clang::BinaryOperator const*)
ExprConstant.cpp:0:0
#14 0x00005559f1c24ea5 clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous
namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*)
ExprConstant.cpp:0:0
#15 0x00005559f1c135ae Evaluate(clang::APValue&, (anonymous
namespace)::EvalInfo&, clang::Expr const*) ExprConstant.cpp:0:0
#16 0x00005559f1c1d549 EvaluateAsRValue((anonymous namespace)::EvalInfo&,
clang::Expr const*, clang::APValue&) ExprConstant.cpp:0:0
#17 0x00005559f1c1ed52 clang::Expr::EvaluateForOverflow(clang::ASTContext
const&) const (/scratch/software/clang-trunk/bin/clang-13+0x6a5ed52)
#18 0x00005559f0eb9605 clang::Sema::CheckForIntOverflow(clang::Expr*)
(/scratch/software/clang-trunk/bin/clang-13+0x5cf9605)
#19 0x00005559f0f08c01 clang::Sema::CheckCompletedExpr(clang::Expr*,
clang::SourceLocation, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5d48c01)
#20 0x00005559f12ab702 clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x60eb702)
#21 0x00005559f1502efb
clang::Sema::ActOnExprStmt(clang::ActionResult<clang::Expr*, true>, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x6342efb)
#22 0x00005559f0df97c3
clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext)
(/scratch/software/clang-trunk/bin/clang-13+0x5c397c3)
#23 0x00005559f0df0ce2
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::ParsedAttributesWithRange&)
(/scratch/software/clang-trunk/bin/clang-13+0x5c30ce2)
#24 0x00005559f0df16ca
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/scratch/software/clang-trunk/bin/clang-13+0x5c316ca)
#25 0x00005559f0df2649 clang::Parser::ParseCompoundStatementBody(bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5c32649)
#26 0x00005559f0df4c5a clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/scratch/software/clang-trunk/bin/clang-13+0x5c34c5a)
#27 0x00005559f0d3aef2
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/scratch/software/clang-trunk/bin/clang-13+0x5b7aef2)
#28 0x00005559f0d67850 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/scratch/software/clang-trunk/bin/clang-13+0x5ba7850)
#29 0x00005559f0d356f6
clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/scratch/software/clang-trunk/bin/clang-13+0x5b756f6)
#30 0x00005559f0d35ce1
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0) Parser.cpp:0:0
#31 0x00005559f0d3c4e7
clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/scratch/software/clang-trunk/bin/clang-13+0x5b7c4e7)
#32 0x00005559f0d3da7e
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5b7da7e)
#33 0x00005559f0d3de29
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/scratch/software/clang-trunk/bin/clang-13+0x5b7de29)
#34 0x00005559f0d3029a clang::ParseAST(clang::Sema&, bool, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5b7029a)
#35 0x00005559efc77968 clang::CodeGenAction::ExecuteAction()
(/scratch/software/clang-trunk/bin/clang-13+0x4ab7968)
#36 0x00005559ef527599 clang::FrontendAction::Execute()
(/scratch/software/clang-trunk/bin/clang-13+0x4367599)
#37 0x00005559ef4ba7e6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/scratch/software/clang-trunk/bin/clang-13+0x42fa7e6)
#38 0x00005559ef605480
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/scratch/software/clang-trunk/bin/clang-13+0x4445480)
#39 0x00005559ec425696 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/scratch/software/clang-trunk/bin/clang-13+0x1265696)
#40 0x00005559ec4219d8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#41 0x00005559ec34f0e6 main
(/scratch/software/clang-trunk/bin/clang-13+0x118f0e6)
#42 0x00007fe9a94fc0b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#43 0x00005559ec42154e _start
(/scratch/software/clang-trunk/bin/clang-13+0x126154e)
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.git
2e9c75daffddd65e37c3236708b5b133e6f5f2f5)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/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/mutant-96f88f.c
clang-13: note: diagnostic msg: /tmp/mutant-96f88f.sh
clang-13: note: diagnostic msg:

********************

-- 
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/20210626/e18bb003/attachment.html>


More information about the llvm-bugs mailing list