Issue |
148389
|
Summary |
[LV] dyn_cast on a non-existent value
|
Labels |
new issue
|
Assignees |
|
Reporter |
sjoerdmeijer
|
Compiling this:
```
#include <algorithm>
int a;
short c;
char b;
void h(char d, short e[][1], char f[][7]) {
for (short g = 0; g < 17; g++) {
a -= b * (2 / d);
if (std::min(0, -6) ? d ? e[g][g] : 0 : 0)
;
else
c ^= std::min((unsigned)10,
std::min(unsigned(e[g][g]), 9 ? unsigned(f[g][g]) : 0));
}
}
```
with `-Ofast -mcpu=grace -std=c++11` results in:
```
clang++: /llvm-project/llvm/include/llvm/Support/Casting.h:662: decltype(auto) llvm::dyn_cast(From *) [To = llvm::VPWidenRecipe, From = llvm::VPRecipeBase]: As
sertion `detail::isPresent(Val) && "dyn_cast on a non-existent value"' failed
PLEASE submit a bug report to https://github.com/llvm/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 -Ofast -mcpu=grace -std=c++11 <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-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-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>" on function "_Z1hcPA1_sPA7_c"
#0 0x0000000003c7a1b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3c7a1b8)
#1 0x0000000003c77b8c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3c77b8c)
#2 0x0000000003bc7eb8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x000076613ac42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00000000058a2290 llvm::VPPartialReductionRecipe::computeCost(llvm::ElementCount, llvm::VPCostContext&) const::'lambda0'(llvm::VPWidenRecipe*)::operator()(llvm::VPWidenRecipe*) const VPlanRecipes.cpp:0:0
#5 0x00000000058a2682 llvm::VPPartialReductionRecipe::computeCost(llvm::ElementCount, llvm::VPCostContext&) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x58a2682)
#6 0x00000000058a9c56 llvm::VPRecipeBase::cost(llvm::ElementCount, llvm::VPCostContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x58a9c56)
#7 0x000000000586d897 llvm::VPBasicBlock::cost(llvm::ElementCount, llvm::VPCostContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x586d897)
#8 0x0000000005871e34 llvm::VPRegionBlock::cost(llvm::ElementCount, llvm::VPCostContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5871e34)
#9 0x0000000005872a3b llvm::VPlan::cost(llvm::ElementCount, llvm::VPCostContext&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5872a3b)
#10 0x0000000005733e9c llvm::LoopVectorizationPlanner::cost(llvm::VPlan&, llvm::ElementCount) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5733e9c)
#11 0x000000000574263f llvm::LoopVectorizationPlanner::computeBestVF() (.part.0) LoopVectorize.cpp:0:0
```
See also: https://godbolt.org/z/KPGa64vbK
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs