https://llvm.org/bugs/show_bug.cgi?id=30536
Bug ID: 30536 Summary: building clang 4.0 by itself failed Product: clang Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: C++ Assignee: unassignedclangb...@nondot.org Reporter: tomilovanato...@gmail.com CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 17359 --> https://llvm.org/bugs/attachment.cgi?id=17359&action=edit file I use clang 4.0 from trunk (rev. 282470). I build it using g++ against libgcc and libstdc++, then using itself I build it against libc++, libc++abi, compiler-rt and libunwind shipped with llvm. Then I tried to rebuild it using itself and faced the following bug: #0 0x0000000000f83025 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/bin/clang-4.0+0xf83025) #1 0x0000000000f835b6 SignalHandler(int) (/usr/local/bin/clang-4.0+0xf835b6) #2 0x00007f49536fa3d0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113d0) #3 0x000000000240b736 clang::Decl::getAttrs() const (/usr/local/bin/clang-4.0+0x240b736) #4 0x00000000023f7ffa clang::ValueDecl::isWeak() const (/usr/local/bin/clang-4.0+0x23f7ffa) #5 0x00000000024449f7 HandleConversionToBool(clang::APValue const&, bool&) (/usr/local/bin/clang-4.0+0x24449f7) #6 0x00000000024708d7 (anonymous namespace)::IntExprEvaluator::VisitCastExpr(clang::CastExpr const*) (/usr/local/bin/clang-4.0+0x24708d7) #7 0x000000000245f18a clang::StmtVisitorBase<clang::make_const_ptr, (anonymous namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*) (/usr/local/bin/clang-4.0+0x245f18a) #8 0x0000000002447999 Evaluate(clang::APValue&, (anonymous namespace)::EvalInfo&, clang::Expr const*) (/usr/local/bin/clang-4.0+0x2447999) #9 0x00000000024611bf (anonymous namespace)::IntExprEvaluator::VisitBinaryOperator(clang::BinaryOperator const*) (/usr/local/bin/clang-4.0+0x24611bf) #10 0x000000000245e3f6 clang::StmtVisitorBase<clang::make_const_ptr, (anonymous namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*) (/usr/local/bin/clang-4.0+0x245e3f6) #11 0x0000000002447999 Evaluate(clang::APValue&, (anonymous namespace)::EvalInfo&, clang::Expr const*) (/usr/local/bin/clang-4.0+0x2447999) #12 0x000000000245ad1f EvaluateStmt((anonymous namespace)::StmtResult&, (anonymous namespace)::EvalInfo&, clang::Stmt const*, clang::SwitchCase const*) (/usr/local/bin/clang-4.0+0x245ad1f) #13 0x000000000245a5ef EvaluateStmt((anonymous namespace)::StmtResult&, (anonymous namespace)::EvalInfo&, clang::Stmt const*, clang::SwitchCase const*) (/usr/local/bin/clang-4.0+0x245a5ef) #14 0x0000000002448e8e HandleFunctionCall(clang::SourceLocation, clang::FunctionDecl const*, (anonymous namespace)::LValue const*, llvm::ArrayRef<clang::Expr const*>, clang::Stmt const*, (anonymous namespace)::EvalInfo&, clang::APValue&, (anonymous namespace)::LValue const*) (/usr/local/bin/clang-4.0+0x2448e8e) #15 0x0000000002470694 (anonymous namespace)::ExprEvaluatorBase<(anonymous namespace)::IntExprEvaluator>::handleCallExpr(clang::CallExpr const*, clang::APValue&, (anonymous namespace)::LValue const*) (/usr/local/bin/clang-4.0+0x2470694) #16 0x0000000002463f0a (anonymous namespace)::IntExprEvaluator::VisitCallExpr(clang::CallExpr const*) (/usr/local/bin/clang-4.0+0x2463f0a) #17 0x000000000245e463 clang::StmtVisitorBase<clang::make_const_ptr, (anonymous namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*) (/usr/local/bin/clang-4.0+0x245e463) #18 0x0000000002447999 Evaluate(clang::APValue&, (anonymous namespace)::EvalInfo&, clang::Expr const*) (/usr/local/bin/clang-4.0+0x2447999) #19 0x000000000244480a EvaluateAsRValue((anonymous namespace)::EvalInfo&, clang::Expr const*, clang::APValue&) (/usr/local/bin/clang-4.0+0x244480a) #20 0x00000000024445df clang::Expr::EvaluateAsRValue(clang::Expr::EvalResult&, clang::ASTContext const&) const (/usr/local/bin/clang-4.0+0x24445df) #21 0x00000000024448f2 clang::Expr::EvaluateAsBooleanCondition(bool&, clang::ASTContext const&) const (/usr/local/bin/clang-4.0+0x24448f2) #22 0x0000000002300996 (anonymous namespace)::CFGBuilder::evaluateAsBooleanConditionNoCache(clang::Expr*) (/usr/local/bin/clang-4.0+0x2300996) #23 0x00000000022ffecf (anonymous namespace)::CFGBuilder::tryEvaluateBool(clang::Expr*) (/usr/local/bin/clang-4.0+0x22ffecf) #24 0x00000000022fe429 (anonymous namespace)::CFGBuilder::Visit(clang::Stmt*, (anonymous namespace)::AddStmtChoice) (/usr/local/bin/clang-4.0+0x22fe429) #25 0x00000000022ff387 (anonymous namespace)::CFGBuilder::VisitCompoundStmt(clang::CompoundStmt*) (/usr/local/bin/clang-4.0+0x22ff387) #26 0x00000000022f5b95 clang::CFG::buildCFG(clang::Decl const*, clang::Stmt*, clang::ASTContext*, clang::CFG::BuildOptions const&) (/usr/local/bin/clang-4.0+0x22f5b95) #27 0x00000000022ef88d clang::AnalysisDeclContext::getCFG() (/usr/local/bin/clang-4.0+0x22ef88d) #28 0x0000000002100ee4 clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy, clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) (/usr/local/bin/clang-4.0+0x2100ee4) #29 0x0000000001c90f4d clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy const*, clang::Decl const*, clang::BlockExpr const*) (/usr/local/bin/clang-4.0+0x1c90f4d) #30 0x0000000001d64d73 clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) (/usr/local/bin/clang-4.0+0x1d64d73) #31 0x0000000001b26f01 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/usr/local/bin/clang-4.0+0x1b26f01) #32 0x0000000001aac05b clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/usr/local/bin/clang-4.0+0x1aac05b) #33 0x0000000001abf2fd clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/usr/local/bin/clang-4.0+0x1abf2fd) #34 0x0000000001aab0ba clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/usr/local/bin/clang-4.0+0x1aab0ba) #35 0x0000000001aaab13 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/usr/local/bin/clang-4.0+0x1aaab13) #36 0x0000000001aa9ed3 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/local/bin/clang-4.0+0x1aa9ed3) #37 0x0000000001aa91eb clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (/usr/local/bin/clang-4.0+0x1aa91eb) #38 0x0000000001aa5fb7 clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/bin/clang-4.0+0x1aa5fb7) #39 0x00000000013ab13d clang::FrontendAction::Execute() (/usr/local/bin/clang-4.0+0x13ab13d) #40 0x0000000001378448 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/local/bin/clang-4.0+0x1378448) #41 0x0000000001420f91 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/bin/clang-4.0+0x1420f91) #42 0x00000000007530e5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/local/bin/clang-4.0+0x7530e5) #43 0x0000000000751bd8 main (/usr/local/bin/clang-4.0+0x751bd8) #44 0x00007f495231f830 __libc_start_main /build/glibc-GKVZIf/glibc-2.23/csu/../csu/libc-start.c:325:0 #45 0x000000000074f089 _start (/usr/local/bin/clang-4.0+0x74f089) Stack dump: 0. Program arguments: /usr/local/bin/clang-4.0 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name BlockFrequencyInfoImpl.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu sandybridge -target-feature +sse2 -target-feature +cx16 -target-feature -tbm -target-feature -avx512ifma -target-feature -avx512dq -target-feature -fma4 -target-feature -prfchw -target-feature -bmi2 -target-feature -xsavec -target-feature -fsgsbase -target-feature +popcnt -target-feature +aes -target-feature -pcommit -target-feature -xsaves -target-feature -avx512er -target-feature -clwb -target-feature -avx512f -target-feature -pku -target-feature -smap -target-feature +mmx -target-feature -xop -target-feature -rdseed -target-feature -hle -target-feature -sse4a -target-feature -avx512bw -target-feature -clflushopt -target-feature +xsave -target-feature -avx512vl -target-feature -invpcid -target-feature -avx512cd -target-feature -rtm -target-feature -fma -target-feature -bmi -target-feature -mwaitx -target-feature -rdrnd -target-feature +sse4.1 -target-feature +sse4.2 -target-feature -avx2 -target-feature +sse -target-feature -lzcnt -target-feature +pclmul -target-feature -prefetchwt1 -target-feature -f16c -target-feature +ssse3 -target-feature -sgx -target-feature +cmov -target-feature -avx512vbmi -target-feature -movbe -target-feature +xsaveopt -target-feature -sha -target-feature -adx -target-feature -avx512pf -target-feature +sse3 -target-feature +avx -momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -ffunction-sections -fdata-sections -coverage-notes-file /home/user/llvm-build/lib/Analysis/CMakeFiles/LLVMAnalysis.dir/BlockFrequencyInfoImpl.cpp.gcno -resource-dir /usr/local/bin/../lib/clang/4.0.0 -D GTEST_HAS_RTTI=0 -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I /home/user/llvm-build/lib/Analysis -I /home/user/llvm/lib/Analysis -I /home/user/llvm-build/include -I /home/user/llvm/include -D NDEBUG -internal-isystem /usr/local/bin/../include/c++/v1 -internal-isystem /usr/local/include -internal-isystem /usr/local/bin/../lib/clang/4.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Werror=date-time -pedantic -std=gnu++1z -fdeprecated-macro -fdebug-compilation-dir /home/user/llvm-build/lib/Analysis -ferror-limit 19 -fmessage-length 204 -fvisibility-inlines-hidden -fno-rtti -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o CMakeFiles/LLVMAnalysis.dir/BlockFrequencyInfoImpl.cpp.o -x c++ /home/user/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp 1. /home/user/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp:328:1: current parser token 'bool' 2. /home/user/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp:270:61: parsing function body 'llvm::BlockFrequencyInfoImplBase::addToDist' clang-4.0: error: unable to execute command: Segmentation fault (core dumped) clang-4.0: error: clang frontend command failed due to signal (use -v to see invocation) clang version 4.0.0 (trunk 282470) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/local/bin clang-4.0: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. clang-4.0: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-4.0: note: diagnostic msg: /tmp/BlockFrequencyInfoImpl-f7b562.cpp clang-4.0: note: diagnostic msg: /tmp/BlockFrequencyInfoImpl-f7b562.sh clang-4.0: note: diagnostic msg: ******************** lib/Analysis/CMakeFiles/LLVMAnalysis.dir/build.make:257: recipe for target 'lib/Analysis/CMakeFiles/LLVMAnalysis.dir/BlockFrequencyInfoImpl.cpp.o' failed make[2]: *** [lib/Analysis/CMakeFiles/LLVMAnalysis.dir/BlockFrequencyInfoImpl.cpp.o] Error 254 make[2]: *** Waiting for unfinished jobs.... -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs