Skip to content

Assertion failure: PredBB->getSingleSuccessor() == ParentBB in SpeculateAroundPHIs.cpp #42336

@llvmbot

Description

@llvmbot
Bugzilla Link 42991
Resolution FIXED
Resolved on Aug 20, 2019 02:46
Version trunk
OS Linux
Blocks #41819
Attachments reproduce
Reporter LLVM Bugzilla Contributor
CC @zmodem,@isanbard,@m-gupta,@nickdesaulniers

Extended Description

Find this error while using LLVM with assertion to build linux kernel 4.19 in ChromeOS, attached is a reproduce, run with:
clang -S -O2 -x c foo-6848da.c

This has been seen since asm goto is introduced and kernel 4.19 is using it.

Error:

clang-9: llvm/lib/Transforms/Scalar/SpeculateAroundPHIs.cpp:581: void speculatePHIs(ArrayRef<llvm::PHINode *>, SmallPtrSetImpl<llvm::Instruction *> &, SmallSetVector<llvm::BasicBlock *, 16> &, llvm::DominatorTree &): Assertion `PredBB->getSingleSuccessor() == ParentBB && "We need a non-critical predecessor to speculate into."' failed.
Stack dump:
0. Program arguments: /usr/bin/clang-9 -cc1 -triple x86_64-pc-linux-gnu -S -disable-free -main-file-name foo.ii -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file /home/zhizhouy/trunk/src/scripts/Workspace/foo.gcno -resource-dir /usr/lib64/clang/9.0.0 -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/9.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir /home/zhizhouy/trunk/src/scripts/Workspace -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o foo.s -x c foo.ii

  1. parser at end of file
  2. Optimizer
    #​0 0x0000000003ef50f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/bin/clang-9+0x3ef50f8)
    #​1 0x0000000003ef2c30 llvm::sys::RunSignalHandlers() (/usr/bin/clang-9+0x3ef2c30)
    #​2 0x0000000003ef57a8 (/usr/bin/clang-9+0x3ef57a8)
    #​3 0x00007fc3e6eb7540 __restore_rt (/lib64/libpthread.so.0+0x12540)
    #​4 0x00007fc3e5a6fd31 raise (/lib64/libc.so.6+0x35d31)
    #​5 0x00007fc3e5a71a41 abort (/lib64/libc.so.6+0x37a41)
    #​6 0x00007fc3e5a68437 (/lib64/libc.so.6+0x2e437)
    #​7 0x00007fc3e5a684e2 (/lib64/libc.so.6+0x2e4e2)
    #​8 0x0000000004e65361 (/usr/bin/clang-9+0x4e65361)
    #​9 0x0000000004e5fecb llvm::SpeculateAroundPHIsPass::run(llvm::Function&, llvm::AnalysisManagerllvm::Function&) (/usr/bin/clang-9+0x4e5fecb)
    #​10 0x0000000004e3910d (/usr/bin/clang-9+0x4e3910d)
    #​11 0x0000000003888d22 llvm::PassManager<llvm::Function, llvm::AnalysisManagerllvm::Function >::run(llvm::Function&, llvm::AnalysisManagerllvm::Function&) (/usr/bin/clang-9+0x3888d22)
    #​12 0x0000000004e2e92c (/usr/bin/clang-9+0x4e2e92c)
    #​13 0x00000000038875e2 llvm::PassManager<llvm::Module, llvm::AnalysisManagerllvm::Module >::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/usr/bin/clang-9+0x38875e2)
    #​14 0x0000000004e3a62d (/usr/bin/clang-9+0x4e3a62d)
    #​15 0x00000000038875e2 llvm::PassManager<llvm::Module, llvm::AnalysisManagerllvm::Module >::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/usr/bin/clang-9+0x38875e2)
    #​16 0x00000000044b238a (/usr/bin/clang-9+0x44b238a)
    #​17 0x00000000044aaa4a clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_deletellvm::raw_pwrite_stream >) (/usr/bin/clang-9+0x44aaa4a)
    #​18 0x00000000047e94d6 (/usr/bin/clang-9+0x47e94d6)
    #​19 0x000000000580b246 clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/clang-9+0x580b246)
    #​20 0x000000000471f533 clang::FrontendAction::Execute() (/usr/bin/clang-9+0x471f533)
    #​21 0x0000000004693294 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/clang-9+0x4693294)
    #​22 0x00000000047e3b37 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/bin/clang-9+0x47e3b37)
    #​23 0x0000000002a4b1ff cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-9+0x2a4b1ff)
    #​24 0x0000000002a48191 main (/usr/bin/clang-9+0x2a48191)
    #​25 0x00007fc3e5a5ba8e __libc_start_main (/lib64/libc.so.6+0x21a8e)
    #​26 0x0000000002a4502a _start (/usr/bin/clang-9+0x2a4502a)
    clang-9: error: unable to execute command: Aborted
    clang-9: error: clang frontend command failed due to signal (use -v to see invocation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions