Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REGRESSION] Attempt to use a SCEVCouldNotCompute object! building adpcm.c from ffmpeg #51871

Closed
andrewrk opened this issue Nov 17, 2021 · 4 comments
Labels
bugzilla Issues migrated from bugzilla c llvm:crash llvm:SCEV Scalar Evolution

Comments

@andrewrk
Copy link
Member

andrewrk commented Nov 17, 2021

Bugzilla Link 52529
Version 13.0
OS All
Blocks #51489
Attachments adpcm-83.add4.c.gz, adpcm-83add4.sh
CC @DougGregor,@fhahn,@zygoloid,@tstellar

Extended Description

Attempt to use a SCEVCouldNotCompute object!
UNREACHABLE executed at ../lib/Analysis/ScalarEvolution.cpp:404!
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: /home/andy/local/llvm13-debug/bin/clang-13 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free -disable-llvm-verifier -discard-value-names -main-file-name adpcm.c -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -fno-signed-zeros -fno-rounding-math -mconstructor-aliases -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb -fcoverage-compilation-dir=/home/andy/dev/libgroove -nostdsysteminc -nobuiltininc -sys-header-deps -MV -D _DEBUG -D _ISOC99_SOURCE -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D _POSIX_C_SOURCE=200112 -D _XOPEN_SOURCE=600 -D ZLIB_CONST -D HAVE_AV_CONFIG_H -D BUILDING_avcodec -Og -Wno-pointer-to-int-cast -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -Wno-unused-const-variable -Wno-bool-operation -Wno-char-subscripts -std=c11 -fdebug-compilation-dir=/home/andy/dev/libgroove -ferror-limit 19 -fsanitize=alignment,array-bounds,bool,builtin,enum,float-cast-overflow,function,integer-divide-by-zero,nonnull-attribute,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound -fsanitize-trap=alignment,array-bounds,bool,builtin,enum,float-cast-overflow,function,integer-divide-by-zero,nonnull-attribute,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound -stack-protector 2 -stack-protector-buffer-size 4 -fgnuc-version=4.2.1 -fno-caret-diagnostics -fno-spell-checking -target-cpu skylake -target-feature -16bit-mode -target-feature -32bit-mode -target-feature -3dnow -target-feature -3dnowa -target-feature +64bit -target-feature +adx -target-feature +aes -target-feature -amx-bf16 -target-feature -amx-int8 -target-feature -amx-tile -target-feature +avx -target-feature +avx2 -target-feature -avx512bf16 -target-feature -avx512bitalg -target-feature -avx512bw -target-feature -avx512cd -target-feature -avx512dq -target-feature -avx512er -target-feature -avx512f -target-feature -avx512ifma -target-feature -avx512pf -target-feature -avx512vbmi -target-feature -avx512vbmi2 -target-feature -avx512vl -target-feature -avx512vnni -target-feature -avx512vp2intersect -target-feature -avx512vpopcntdq -target-feature -avxvnni -target-feature +bmi -target-feature +bmi2 -target-feature -branchfusion -target-feature -cldemote -target-feature +clflushopt -target-feature -clwb -target-feature -clzero -target-feature +cmov -target-feature +cx16 -target-feature +cx8 -target-feature -enqcmd -target-feature +ermsb -target-feature +f16c -target-feature -false-deps-lzcnt-tzcnt -target-feature +false-deps-popcnt -target-feature -fast-11bytenop -target-feature +fast-15bytenop -target-feature -fast-7bytenop -target-feature -fast-bextr -target-feature +fast-gather -target-feature -fast-hops -target-feature -fast-lzcnt -target-feature -fast-movbe -target-feature +fast-scalar-fsqrt -target-feature -fast-scalar-shift-masks -target-feature +fast-shld-rotate -target-feature +fast-variable-crosslane-shuffle -target-feature +fast-variable-perlane-shuffle -target-feature +fast-vector-fsqrt -target-feature -fast-vector-shift-masks -target-feature +fma -target-feature -fma4 -target-feature +fsgsbase -target-feature -fsrm -target-feature +fxsr -target-feature -gfni -target-feature -hreset -target-feature -idivl-to-divb -target-feature +idivq-to-divl -target-feature +invpcid -target-feature -kl -target-feature -lea-sp -target-feature -lea-uses-ag -target-feature -lvi-cfi -target-feature -lvi-load-hardening -target-feature -lwp -target-feature +lzcnt -target-feature +macrofusion -target-feature +mmx -target-feature +movbe -target-feature -movdir64b -target-feature -movdiri -target-feature -mwaitx -target-feature +nopl -target-feature -pad-short-functions -target-feature +pclmul -target-feature -pconfig -target-feature -pku -target-feature +popcnt -target-feature -prefer-128-bit -target-feature -prefer-256-bit -target-feature -prefer-mask-registers -target-feature -prefetchwt1 -target-feature +prfchw -target-feature -ptwrite -target-feature -rdpid -target-feature +rdrnd -target-feature +rdseed -target-feature -retpoline -target-feature -retpoline-external-thunk -target-feature -retpoline-indirect-branches -target-feature -retpoline-indirect-calls -target-feature -rtm -target-feature +sahf -target-feature -serialize -target-feature -seses -target-feature +sgx -target-feature -sha -target-feature -shstk -target-feature +slow-3ops-lea -target-feature -slow-incdec -target-feature -slow-lea -target-feature -slow-pmaddwd -target-feature -slow-pmulld -target-feature -slow-shld -target-feature -slow-two-mem-ops -target-feature -slow-unaligned-mem-16 -target-feature -slow-unaligned-mem-32 -target-feature -soft-float -target-feature +sse -target-feature +sse2 -target-feature +sse3 -target-feature +sse4.1 -target-feature +sse4.2 -target-feature -sse4a -target-feature -sse-unaligned-mem -target-feature +ssse3 -target-feature -tbm -target-feature -tsxldtrk -target-feature -uintr -target-feature -use-aa -target-feature -use-glm-div-sqrt-costs -target-feature -vaes -target-feature -vpclmulqdq -target-feature +vzeroupper -target-feature -waitpkg -target-feature -wbnoinvd -target-feature -widekl -target-feature +x87 -target-feature -xop -target-feature +xsave -target-feature +xsavec -target-feature +xsaveopt -target-feature +xsaves -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c adpcm-83add4.c
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module 'adpcm-83add4.c'.
4.	Running pass 'Loop Pass Manager' on function '@adpcm_decode_frame'
5.	Running pass 'Loop Strength Reduction' on basic block '%6671'
 #&#8203;0 0x0000000004ecfae9 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Support/Unix/Signals.inc:565:22
 #&#8203;1 0x0000000004ecfba0 PrintStackTraceSignalHandler(void*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Support/Unix/Signals.inc:632:1
 #&#8203;2 0x0000000004ecdb7c llvm::sys::RunSignalHandlers() /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Support/Signals.cpp:97:20
 #&#8203;3 0x0000000004ecf530 SignalHandler(int) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Support/Unix/Signals.inc:407:1
 #&#8203;4 0x00007fec5a889ee0 __restore_rt (/nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/libpthread.so.0+0x12ee0)
 #&#8203;5 0x00007fec5a385ffa raise (/nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/libc.so.6+0x37ffa)
 #&#8203;6 0x00007fec5a370528 abort (/nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/libc.so.6+0x22528)
 #&#8203;7 0x0000000004e12609 bindingsErrorHandler(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Support/ErrorHandling.cpp:222:55
 #&#8203;8 0x0000000003a9326e llvm::SCEV::getType() const /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:406:3
 #&#8203;9 0x0000000003ac23b5 llvm::ScalarEvolution::isImpliedViaOperations(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, unsigned int) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:11189:3
#&#8203;10 0x0000000003ac3019 llvm::ScalarEvolution::isImpliedCondOperandsHelper(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:11433:29
#&#8203;11 0x0000000003ac1f70 llvm::ScalarEvolution::isImpliedCondOperands(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::Instruction const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:11105:56
#&#8203;12 0x0000000003ac052c llvm::ScalarEvolution::isImpliedCondBalancedTypes(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::Instruction const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:10675:33
#&#8203;13 0x0000000003ac01bb llvm::ScalarEvolution::isImpliedCond(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::Instruction const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:10617:36
#&#8203;14 0x0000000003abebee llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(llvm::Loop const*, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:10334:22
#&#8203;15 0x0000000003abd3d0 llvm::ScalarEvolution::isKnownViaInduction(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:9883:55
#&#8203;16 0x0000000003abd476 llvm::ScalarEvolution::isKnownPredicate(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:9892:3
#&#8203;17 0x0000000003ac2122 IsKnownPredicateViaAddRecStart(llvm::ScalarEvolution&, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:11148:68
#&#8203;18 0x0000000003ac2daf llvm::ScalarEvolution::isKnownViaNonRecursiveReasoning(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:11389:61
#&#8203;19 0x0000000003ac2fa9 llvm::ScalarEvolution::isImpliedCondOperandsHelper(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:11426:76
#&#8203;20 0x0000000003ac1f70 llvm::ScalarEvolution::isImpliedCondOperands(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::Instruction const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:11105:56
#&#8203;21 0x0000000003ac09ed llvm::ScalarEvolution::isImpliedCondBalancedTypes(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::Instruction const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:10773:32
#&#8203;22 0x0000000003ac01bb llvm::ScalarEvolution::isImpliedCond(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::Instruction const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:10617:36
#&#8203;23 0x0000000003abfd83 llvm::ScalarEvolution::isImpliedCond(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::Value const*, bool, llvm::Instruction const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:10566:23
#&#8203;24 0x0000000003abf2f2 llvm::ScalarEvolution::isBasicBlockEntryGuardedByCond(llvm::BasicBlock const*, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*)::'lambda2'(llvm::Value const*, bool)::operator()(llvm::Value const*, bool) const /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:10452:22
#&#8203;25 0x0000000003abf73f llvm::ScalarEvolution::isBasicBlockEntryGuardedByCond(llvm::BasicBlock const*, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:10484:5
#&#8203;26 0x0000000003abf977 llvm::ScalarEvolution::isLoopEntryGuardedByCond(llvm::Loop const*, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:10522:71
#&#8203;27 0x0000000003abd736 llvm::ScalarEvolution::isKnownOnEveryIteration(llvm::CmpInst::Predicate, llvm::SCEVAddRecExpr const*, llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:9941:66
#&#8203;28 0x0000000003aa5f2b llvm::ScalarEvolution::proveNoSignedWrapViaInduction(llvm::SCEVAddRecExpr const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:4702:64
#&#8203;29 0x0000000003a99317 llvm::ScalarEvolution::getSignExtendExpr(llvm::SCEV const*, llvm::Type*, unsigned int) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/ScalarEvolution.cpp:2063:52
#&#8203;30 0x0000000004ff9e51 IsIncrementNSW(llvm::ScalarEvolution&, llvm::SCEVAddRecExpr const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1187:44
#&#8203;31 0x0000000004ffa83f llvm::SCEVExpander::getAddRecExprPHILiterally(llvm::SCEVAddRecExpr const*, llvm::Loop const*, llvm::Type*, llvm::Type*, llvm::Type*&, bool&) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1356:38
#&#8203;32 0x0000000004ffafb5 llvm::SCEVExpander::expandAddRecExprLiterally(llvm::SCEVAddRecExpr const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1460:42
#&#8203;33 0x0000000004ffb6d9 llvm::SCEVExpander::visitAddRecExpr(llvm::SCEVAddRecExpr const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1570:37
#&#8203;34 0x000000000500b8af llvm::SCEVVisitor<llvm::SCEVExpander, llvm::Value*>::visit(llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../include/llvm/Analysis/ScalarEvolutionExpressions.h:596:69
#&#8203;35 0x0000000004ffdc75 llvm::SCEVExpander::expand(llvm::SCEV const*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Utils/ScalarEvolutionExpander.cpp:2000:14
#&#8203;36 0x0000000004ffd246 llvm::SCEVExpander::expandCodeForImpl(llvm::SCEV const*, llvm::Type*, bool) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1863:20
#&#8203;37 0x0000000004ba9b29 llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*, llvm::Type*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../include/llvm/Transforms/Utils/ScalarEvolutionExpander.h:285:3
#&#8203;38 0x0000000004c4a4e3 (anonymous namespace)::LSRInstance::Expand((anonymous namespace)::LSRUse const&, (anonymous namespace)::LSRFixup const&, (anonymous namespace)::Formula const&, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, false>, llvm::SCEVExpander&, llvm::SmallVectorImpl<llvm::WeakTrackingVH>&) const /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Scalar/LoopStrengthReduce.cpp:5272:18
#&#8203;39 0x0000000004c4b6ef (anonymous namespace)::LSRInstance::Rewrite((anonymous namespace)::LSRUse const&, (anonymous namespace)::LSRFixup const&, (anonymous namespace)::Formula const&, llvm::SCEVExpander&, llvm::SmallVectorImpl<llvm::WeakTrackingVH>&) const /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Scalar/LoopStrengthReduce.cpp:5538:13
#&#8203;40 0x0000000004c4ba8a (anonymous namespace)::LSRInstance::ImplementSolution(llvm::SmallVectorImpl<(anonymous namespace)::Formula const*> const&) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Scalar/LoopStrengthReduce.cpp:5591:15
#&#8203;41 0x0000000004c4c81d (anonymous namespace)::LSRInstance::LSRInstance(llvm::Loop*, llvm::IVUsers&, llvm::ScalarEvolution&, llvm::DominatorTree&, llvm::LoopInfo&, llvm::TargetTransformInfo const&, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::MemorySSAUpdater*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Scalar/LoopStrengthReduce.cpp:5772:20
#&#8203;42 0x0000000004c4da1f ReduceLoopStrength(llvm::Loop*, llvm::IVUsers&, llvm::ScalarEvolution&, llvm::DominatorTree&, llvm::LoopInfo&, llvm::TargetTransformInfo const&, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::MemorySSA*) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Scalar/LoopStrengthReduce.cpp:6287:63
#&#8203;43 0x0000000004c4df14 (anonymous namespace)::LoopStrengthReduce::runOnLoop(llvm::Loop*, llvm::LPPassManager&) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Transforms/Scalar/LoopStrengthReduce.cpp:6345:28
#&#8203;44 0x00000000039cefe6 llvm::LPPassManager::runOnFunction(llvm::Function&) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/Analysis/LoopPass.cpp:198:36
#&#8203;45 0x00000000043c84a5 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/IR/LegacyPassManager.cpp:1439:20
#&#8203;46 0x00000000043c8710 llvm::FPPassManager::runOnModule(llvm::Module&) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/IR/LegacyPassManager.cpp:1485:13
#&#8203;47 0x00000000043c8b3a (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/IR/LegacyPassManager.cpp:1554:20
#&#8203;48 0x00000000043c41be llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/IR/LegacyPassManager.cpp:542:13
#&#8203;49 0x00000000043c9323 llvm::legacy::PassManager::run(llvm::Module&) /home/andy/Downloads/llvm-project-13/llvm/build-debug/../lib/IR/LegacyPassManager.cpp:1682:1
#&#8203;50 0x0000000005235a2b (anonymous namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) BackendUtil.cpp:0:0
#&#8203;51 0x000000000523769d clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/home/andy/local/llvm13-debug/bin/clang-13+0x523769d)
#&#8203;52 0x000000000611290f clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/andy/local/llvm13-debug/bin/clang-13+0x611290f)
#&#8203;53 0x0000000006f402c9 clang::ParseAST(clang::Sema&, bool, bool) (/home/andy/local/llvm13-debug/bin/clang-13+0x6f402c9)
#&#8203;54 0x0000000006111458 clang::CodeGenAction::ExecuteAction() (/home/andy/local/llvm13-debug/bin/clang-13+0x6111458)
#&#8203;55 0x00000000058fdbc9 clang::FrontendAction::Execute() (/home/andy/local/llvm13-debug/bin/clang-13+0x58fdbc9)
#&#8203;56 0x0000000005895da6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/andy/local/llvm13-debug/bin/clang-13+0x5895da6)
#&#8203;57 0x00000000059d7890 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/andy/local/llvm13-debug/bin/clang-13+0x59d7890)
#&#8203;58 0x0000000001eac8d5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/andy/local/llvm13-debug/bin/clang-13+0x1eac8d5)
#&#8203;59 0x0000000001ea8d48 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#&#8203;60 0x0000000001e99eb2 main (/home/andy/local/llvm13-debug/bin/clang-13+0x1e99eb2)
#&#8203;61 0x00007fec5a371cbd __libc_start_main (/nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/libc.so.6+0x23cbd)
#&#8203;62 0x0000000001ea88fa _start /build/glibc-2.31/csu/../sysdeps/x86_64/start.S:122:0
adpcm-83add4.sh: line 4: 16495 Aborted                 (core dumped) "/home/andy/local/llvm13-debug/bin/clang-13" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "--mrelax-relocations" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "adpcm.c" "-mrelocation-model" "pic" "-pic-level" "2" "-fhalf-no-semantic-interposition" "-mframe-pointer=all" "-fno-signed-zeros" "-fno-rounding-math" "-mconstructor-aliases" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-debug-info-kind=constructor" "-dwarf-version=4" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=/home/andy/dev/libgroove" "-nostdsysteminc" "-nobuiltininc" "-sys-header-deps" "-MV" "-D" "_DEBUG" "-D" "_ISOC99_SOURCE" "-D" "_FILE_OFFSET_BITS=64" "-D" "_LARGEFILE_SOURCE" "-D" "_POSIX_C_SOURCE=200112" "-D" "_XOPEN_SOURCE=600" "-D" "ZLIB_CONST" "-D" "HAVE_AV_CONFIG_H" "-D" "BUILDING_avcodec" "-Og" "-Wno-pointer-to-int-cast" "-Wno-parentheses" "-Wno-switch" "-Wno-format-zero-length" "-Wno-pointer-sign" "-Wno-unused-const-variable" "-Wno-bool-operation" "-Wno-char-subscripts" "-std=c11" "-fdebug-compilation-dir=/home/andy/dev/libgroove" "-ferror-limit" "19" "-fsanitize=alignment,array-bounds,bool,builtin,enum,float-cast-overflow,function,integer-divide-by-zero,nonnull-attribute,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound" "-fsanitize-trap=alignment,array-bounds,bool,builtin,enum,float-cast-overflow,function,integer-divide-by-zero,nonnull-attribute,null,object-size,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound" "-stack-protector" "2" "-stack-protector-buffer-size" "4" "-fgnuc-version=4.2.1" "-fno-caret-diagnostics" "-fno-spell-checking" "-target-cpu" "skylake" "-target-feature" "-16bit-mode" "-target-feature" "-32bit-mode" "-target-feature" "-3dnow" "-target-feature" "-3dnowa" "-target-feature" "+64bit" "-target-feature" "+adx" "-target-feature" "+aes" "-target-feature" "-amx-bf16" "-target-feature" "-amx-int8" "-target-feature" "-amx-tile" "-target-feature" "+avx" "-target-feature" "+avx2" "-target-feature" "-avx512bf16" "-target-feature" "-avx512bitalg" "-target-feature" "-avx512bw" "-target-feature" "-avx512cd" "-target-feature" "-avx512dq" "-target-feature" "-avx512er" "-target-feature" "-avx512f" "-target-feature" "-avx512ifma" "-target-feature" "-avx512pf" "-target-feature" "-avx512vbmi" "-target-feature" "-avx512vbmi2" "-target-feature" "-avx512vl" "-target-feature" "-avx512vnni" "-target-feature" "-avx512vp2intersect" "-target-feature" "-avx512vpopcntdq" "-target-feature" "-avxvnni" "-target-feature" "+bmi" "-target-feature" "+bmi2" "-target-feature" "-branchfusion" "-target-feature" "-cldemote" "-target-feature" "+clflushopt" "-target-feature" "-clwb" "-target-feature" "-clzero" "-target-feature" "+cmov" "-target-feature" "+cx16" "-target-feature" "+cx8" "-target-feature" "-enqcmd" "-target-feature" "+ermsb" "-target-feature" "+f16c" "-target-feature" "-false-deps-lzcnt-tzcnt" "-target-feature" "+false-deps-popcnt" "-target-feature" "-fast-11bytenop" "-target-feature" "+fast-15bytenop" "-target-feature" "-fast-7bytenop" "-target-feature" "-fast-bextr" "-target-feature" "+fast-gather" "-target-feature" "-fast-hops" "-target-feature" "-fast-lzcnt" "-target-feature" "-fast-movbe" "-target-feature" "+fast-scalar-fsqrt" "-target-feature" "-fast-scalar-shift-masks" "-target-feature" "+fast-shld-rotate" "-target-feature" "+fast-variable-crosslane-shuffle" "-target-feature" "+fast-variable-perlane-shuffle" "-target-feature" "+fast-vector-fsqrt" "-target-feature" "-fast-vector-shift-masks" "-target-feature" "+fma" "-target-feature" "-fma4" "-target-feature" "+fsgsbase" "-target-feature" "-fsrm" "-target-feature" "+fxsr" "-target-feature" "-gfni" "-target-feature" "-hreset" "-target-feature" "-idivl-to-divb" "-target-feature" "+idivq-to-divl" "-target-feature" "+invpcid" "-target-feature" "-kl" "-target-feature" "-lea-sp" "-target-feature" "-lea-uses-ag" "-target-feature" "-lvi-cfi" "-target-feature" "-lvi-load-hardening" "-target-feature" "-lwp" "-target-feature" "+lzcnt" "-target-feature" "+macrofusion" "-target-feature" "+mmx" "-target-feature" "+movbe" "-target-feature" "-movdir64b" "-target-feature" "-movdiri" "-target-feature" "-mwaitx" "-target-feature" "+nopl" "-target-feature" "-pad-short-functions" "-target-feature" "+pclmul" "-target-feature" "-pconfig" "-target-feature" "-pku" "-target-feature" "+popcnt" "-target-feature" "-prefer-128-bit" "-target-feature" "-prefer-256-bit" "-target-feature" "-prefer-mask-registers" "-target-feature" "-prefetchwt1" "-target-feature" "+prfchw" "-target-feature" "-ptwrite" "-target-feature" "-rdpid" "-target-feature" "+rdrnd" "-target-feature" "+rdseed" "-target-feature" "-retpoline" "-target-feature" "-retpoline-external-thunk" "-target-feature" "-retpoline-indirect-branches" "-target-feature" "-retpoline-indirect-calls" "-target-feature" "-rtm" "-target-feature" "+sahf" "-target-feature" "-serialize" "-target-feature" "-seses" "-target-feature" "+sgx" "-target-feature" "-sha" "-target-feature" "-shstk" "-target-feature" "+slow-3ops-lea" "-target-feature" "-slow-incdec" "-target-feature" "-slow-lea" "-target-feature" "-slow-pmaddwd" "-target-feature" "-slow-pmulld" "-target-feature" "-slow-shld" "-target-feature" "-slow-two-mem-ops" "-target-feature" "-slow-unaligned-mem-16" "-target-feature" "-slow-unaligned-mem-32" "-target-feature" "-soft-float" "-target-feature" "+sse" "-target-feature" "+sse2" "-target-feature" "+sse3" "-target-feature" "+sse4.1" "-target-feature" "+sse4.2" "-target-feature" "-sse4a" "-target-feature" "-sse-unaligned-mem" "-target-feature" "+ssse3" "-target-feature" "-tbm" "-target-feature" "-tsxldtrk" "-target-feature" "-uintr" "-target-feature" "-use-aa" "-target-feature" "-use-glm-div-sqrt-costs" "-target-feature" "-vaes" "-target-feature" "-vpclmulqdq" "-target-feature" "+vzeroupper" "-target-feature" "-waitpkg" "-target-feature" "-wbnoinvd" "-target-feature" "-widekl" "-target-feature" "+x87" "-target-feature" "-xop" "-target-feature" "+xsave" "-target-feature" "+xsavec" "-target-feature" "+xsaveopt" "-target-feature" "+xsaves" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-x" "c" "adpcm-83add4.c"
@fhahn
Copy link
Contributor

fhahn commented Nov 17, 2021

I am unable to reproduce the crash on top of current main.

Andrew, are you able to reproduce this with current main or is it a 13.0-only issue?

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
@asl asl added this to the LLVM 13.0.1 release milestone Dec 12, 2021
@andrewrk
Copy link
Member Author

I'm sorry; I won't have time to test this on more than the 13.x branch. I'm fine with closing the issue and waiting until 14.x for the fix.

@tstellar tstellar removed this from the LLVM 13.0.1 release milestone Jan 4, 2022
@tstellar
Copy link
Collaborator

tstellar commented Jan 4, 2022

I'm sorry; I won't have time to test this on more than the 13.x branch. I'm fine with closing the issue and waiting until 14.x for the fix.

Ok, I'm removing the LLVM 13.0.1 release milestone.

@Endilll
Copy link
Contributor

Endilll commented Aug 8, 2023

Appears to be fixed in Clang 14.
Reduced by C-Reduce:

bytestream2_get_le32u___trans_tmp_1, get_nb_samples_n;
*get_nb_samples_adpcm_decode_frame_avctx_0;
bytestream2_get_le32u(*g) {
  char **b = g;
  *b += 4;
  bytestream2_get_le32u___trans_tmp_1 = (int *)*b - 4;
}
bytestream2_get_byteu(*g) {
  int **b = g;
  *b += -1;
}
typedef struct {
  int step_index
} ADPCMChannelStatus;
typedef struct {
  ADPCMChannelStatus status[0]
} ADPCMDecodeContext;
get_nb_samples() {
  ADPCMDecodeContext *c = get_nb_samples_adpcm_decode_frame_avctx_0;
  int i;
  int *gb;
  for (; i; i++)
    c->status[i].step_index = bytestream2_get_le32u(&gb);
  for (; i <= 1; i++)
    bytestream2_get_le32u(&gb);
  for (; get_nb_samples_n;)
    bytestream2_get_byteu(&gb);
}

Invocation:
clang -cc1 -emit-obj -Og -std=c11 -fsanitize=alignment,pointer-overflow -x c pp.i

@Endilll Endilll closed this as completed Aug 8, 2023
@Endilll Endilll added llvm:crash llvm:SCEV Scalar Evolution labels Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c llvm:crash llvm:SCEV Scalar Evolution
Projects
None yet
Development

No branches or pull requests

5 participants