Open
Description
Compiling this:
extern char a[][12][12];
int b;
void c(bool d) {
for (unsigned e(b); e < 10; e++)
for (short f(d); f < 012; f += 2)
a[e - 3][f][e] = 0;
}
with -std=c++11 -Ofast -floop-interchange -mcpu=grace
results in this assert:
SIV test expected at least one AddRec
UNREACHABLE executed at llvm-project/llvm/lib/Analysis/DependenceAnalysis.cpp:2295!
/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -fno-verbose-asm -S -target aarch64-linux-gnu --gcc-toolchain=/opt/compiler-explorer/arm64/gcc-12.2.0/aarch64-unknown-linux-gnu --sysroot=/opt/compiler-explorer/arm64/gcc-12.2.0/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot -fcolor-diagnostics -fno-crash-diagnostics -std=c++11 -Ofast -floop-interchange -mcpu=grace <source>
1. <eof> parser at end of file
2. Optimizer
3. Running pass "function<eager-inv>(float2int,lower-constant-intrinsics,chr,loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion,loop-interchange),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,slp-vectorizer,vector-combine,instcombine<max-iterations=1;no-verify-fixpoint>,loop-unroll<O3>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;speculate-unpredictables>)" on module "<source>"
4. Running pass "loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion,loop-interchange)" on function "_Z1cb"
#0 0x0000000003c7a568 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3c7a568)
#1 0x0000000003c77f3c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3c77f3c)
#2 0x0000000003bc8268 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x000073d0dee42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000073d0defa0d10 (/lib/x86_64-linux-gnu/libc.so.6+0x1a0d10)
#5 0x0000000002bdfd1f llvm::SCEVAddRecExpr::getStepRecurrence(llvm::ScalarEvolution&) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x2bdfd1f)
#6 0x0000000002be9a93 llvm::DependenceInfo::testSIV(llvm::SCEV const*, llvm::SCEV const*, unsigned int&, llvm::FullDependence&, llvm::DependenceInfo::Constraint&, llvm::SCEV const*&) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x2be9a93)
#7 0x0000000002bef31d llvm::DependenceInfo::depends(llvm::Instruction*, llvm::Instruction*, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x2bef31d)
#8 0x0000000007c32d00 (anonymous namespace)::LoopInterchange::processLoopList(llvm::SmallVectorImpl<llvm::Loop*>&) LoopInterchange.cpp:0:0
See also: