opencilk-project icon indicating copy to clipboard operation
opencilk-project copied to clipboard

Assertion `i < getNumSuccessors() && "Successor # out of range for Branch!"' failed.

Open wheatman opened this issue 7 months ago • 1 comments

Describe the bug

Triggered an assertion failed when compiling some code

Expected behavior

for the code to compile successfully as it did with opencilk based on clang 16

OpenCilk version

broken version

clang version 19.1.7 (https://github.com/OpenCilk/opencilk-project cd64ec3e6aa1190a99332cbabc57af8c35f1818e) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/wheatman/opencilk3.0rc1/build/bin Build config: +assertions

working version clang version 16.0.6 (https://github.com/OpenCilk/opencilk-project df80b7d1b218109ee7427c0ef498848d9a63c118) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/wheatman/opencilk16/build/bin/.

System information

PRETTY_NAME="Ubuntu 22.04.5 LTS" on WSL

full back trace

clang-19: /home/wheatman/opencilk3.0rc1/opencilk/llvm/include/llvm/IR/Instructions.h:3004: BasicBlock *llvm::BranchInst::getSuccessor(unsigned int) const: Assertion `i < getNumSuccessors() && "Successor # out of range for Branch!"' failed. PLEASE submit a bug report to https://github.com/OpenCilk/opencilk-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0. Program arguments: /home/wheatman/opencilk3.0rc1/build/bin/clang-19 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -dumpdir basic- -disable-free -clear-ast-before-backend -main-file-name driver.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -menable-no-infs -menable-no-nans -fapprox-func -funsafe-math-optimizations -fno-signed-zeros -mreassociate -freciprocal-math -ffp-contract=fast -fno-rounding-math -ffast-math -ffinite-math-only -complex-range=basic -mconstructor-aliases -funwind-tables=2 -target-cpu alderlake -target-feature +prfchw -target-feature -cldemote -target-feature +avx -target-feature +aes -target-feature +sahf -target-feature +pclmul -target-feature -xop -target-feature +crc32 -target-feature +xsaves -target-feature -avx512fp16 -target-feature -usermsr -target-feature -sm4 -target-feature -egpr -target-feature +sse4.1 -target-feature -avx512ifma -target-feature +xsave -target-feature +sse4.2 -target-feature -tsxldtrk -target-feature -sm3 -target-feature -ptwrite -target-feature -widekl -target-feature +invpcid -target-feature +64bit -target-feature +xsavec -target-feature -avx10.1-512 -target-feature -avx512vpopcntdq -target-feature +cmov -target-feature -avx512vp2intersect -target-feature -avx512cd -target-feature +movbe -target-feature -avxvnniint8 -target-feature -ccmp -target-feature -amx-int8 -target-feature -kl -target-feature -avx10.1-256 -target-feature -sha512 -target-feature +avxvnni -target-feature -rtm -target-feature +adx -target-feature +avx2 -target-feature -hreset -target-feature +movdiri -target-feature +serialize -target-feature +vpclmulqdq -target-feature -avx512vl -target-feature -uintr -target-feature -cf -target-feature +clflushopt -target-feature -raoint -target-feature -cmpccxadd -target-feature +bmi -target-feature -amx-tile -target-feature +sse -target-feature +gfni -target-feature -avxvnniint16 -target-feature -amx-fp16 -target-feature -ndd -target-feature +xsaveopt -target-feature +rdrnd -target-feature -avx512f -target-feature -amx-bf16 -target-feature -avx512bf16 -target-feature -avx512vnni -target-feature -push2pop2 -target-feature +cx8 -target-feature -avx512bw -target-feature +sse3 -target-feature -pku -target-feature +fsgsbase -target-feature -clzero -target-feature -mwaitx -target-feature -lwp -target-feature +lzcnt -target-feature +sha -target-feature +movdir64b -target-feature -ppx -target-feature -wbnoinvd -target-feature -enqcmd -target-feature -avxneconvert -target-feature -tbm -target-feature -pconfig -target-feature -amx-complex -target-feature +ssse3 -target-feature +cx16 -target-feature +bmi2 -target-feature +fma -target-feature +popcnt -target-feature -avxifma -target-feature +f16c -target-feature -avx512bitalg -target-feature -rdpru -target-feature +clwb -target-feature +mmx -target-feature +sse2 -target-feature +rdseed -target-feature -avx512vbmi2 -target-feature -prefetchi -target-feature +rdpid -target-feature -fma4 -target-feature -avx512vbmi -target-feature +shstk -target-feature +vaes -target-feature +waitpkg -target-feature -sgx -target-feature +fxsr -target-feature -avx512dq -target-feature -sse4a -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb -fdebug-compilation-dir=/home/wheatman/ConcurrentAdaptor -fcoverage-compilation-dir=/home/wheatman/ConcurrentAdaptor -resource-dir /home/wheatman/opencilk3.0rc1/build/lib/clang/19 -I parlaylib/include/ -I CPAM/include/ -I include/ -I cxxopts/include/ -D NDEBUG -D DEBUG=0 -D CORRECTNESS=0 -D PARLAY_OPENCILK=On -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/backward -internal-isystem /home/wheatman/opencilk3.0rc1/build/lib/clang/19/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Ofast -Wall -Wextra -std=c++20 -fdeprecated-macro -ferror-limit 19 -fopencilk --opencilk-abi-bitcode=/home/wheatman/opencilk3.0rc1/build/lib/clang/19/lib/x86_64-unknown-linux-gnu/libopencilk-abi.bc -fgnuc-version=4.2.1 -fno-implicit-modules -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -stripmine-loops -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/driver-e6e0e2.o -x c++ driver.cpp

  1.  <eof> parser at end of file
    
  2.  Optimizer
    
  3.  Running pass "loop-spawning" on module "driver.cpp"
    

#0 0x000055f79a123dc8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x2481dc8) #1 0x000055f79a1218ee llvm::sys::RunSignalHandlers() (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x247f8ee) #2 0x000055f79a1245a8 SignalHandler(int) Signals.cpp:0:0 #3 0x00007f8835967520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) #4 0x00007f88359bb9fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76 #5 0x00007f88359bb9fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10 #6 0x00007f88359bb9fc pthread_kill ./nptl/pthread_kill.c:89:10 #7 0x00007f8835967476 gsignal ./signal/../sysdeps/posix/raise.c:27:6 #8 0x00007f883594d7f3 abort ./stdlib/abort.c:81:7 #9 0x00007f883594d71b _nl_load_domain ./intl/loadmsgcat.c:1177:9 #10 0x00007f883595ee96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96) #11 0x000055f799c44d22 llvm::Instruction::getSuccessor(unsigned int) const (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x1fa2d22) #12 0x000055f79a142380 llvm::TapirLoopInfo::TapirLoopInfo(llvm::Loop*, llvm::Task*) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x24a0380) #13 0x000055f79a139a78 (anonymous namespace)::LoopSpawningImpl::run() LoopSpawningTI.cpp:0:0 #14 0x000055f79a138e4d llvm::LoopSpawningPass::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x2496e4d) #15 0x000055f79b401c7d llvm::detail::PassModel<llvm::Module, llvm::LoopSpawningPass, llvm::AnalysisManagerllvm::Module>::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x375fc7d) #16 0x000055f799cb6d5a llvm::PassManager<llvm::Module, llvm::AnalysisManagerllvm::Module>::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x2014d5a) #17 0x000055f79a3d4350 (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_deletellvm::raw_pwrite_stream>&, std::unique_ptr<llvm::ToolOutputFile, std::default_deletellvm::ToolOutputFile>&, clang::BackendConsumer*) BackendUtil.cpp:0:0 #18 0x000055f79a3c9da1 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtrllvm::vfs::FileSystem, std::unique_ptr<llvm::raw_pwrite_stream, std::default_deletellvm::raw_pwrite_stream>, clang::BackendConsumer*) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x2727da1) #19 0x000055f79a97f210 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x2cdd210) #20 0x000055f79c640d79 clang::ParseAST(clang::Sema&, bool, bool) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x499ed79) #21 0x000055f79ac38aff clang::FrontendAction::Execute() (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x2f96aff) #22 0x000055f79aba31ad clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x2f011ad) #23 0x000055f79ad19c87 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0x3077c87) #24 0x000055f798be0072 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0xf3e072) #25 0x000055f798bdc8be ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0 #26 0x000055f798bdb6e9 clang_main(int, char**, llvm::ToolContext const&) (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0xf396e9) #27 0x000055f798bec427 main (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0xf4a427) #28 0x00007f883594ed90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 #29 0x00007f883594ee40 call_init ./csu/../csu/libc-start.c:128:20 #30 0x00007f883594ee40 __libc_start_main ./csu/../csu/libc-start.c:379:5 #31 0x000055f798bda2a5 _start (/home/wheatman/opencilk3.0rc1/build/bin/clang-19+0xf382a5) clang++: error: unable to execute command: Aborted (core dumped) clang++: error: clang frontend command failed due to signal (use -v to see invocation) clang version 19.1.7 (https://github.com/OpenCilk/opencilk-project cd64ec3e6aa1190a99332cbabc57af8c35f1818e) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/wheatman/opencilk3.0rc1/build/bin Build config: +assertions clang++: warning: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Wdeprecated-ofast] clang++: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang++: note: diagnostic msg: /tmp/driver-d759e9.cpp clang++: note: diagnostic msg: /tmp/driver-d759e9.sh clang++: note: diagnostic msg:

driver-d759e9.sh.txt driver-d759e9.cpp.txt

wheatman avatar Mar 24 '25 22:03 wheatman