[llvm-bugs] [Bug 35432] New: clang compilation fails with assertion "Invalid loop count" in Loop Vectorization
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Nov 27 06:22:14 PST 2017
https://bugs.llvm.org/show_bug.cgi?id=35432
Bug ID: 35432
Summary: clang compilation fails with assertion "Invalid loop
count" in Loop Vectorization
Product: new-bugs
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: ilia.taraban at intel.com
CC: llvm-bugs at lists.llvm.org
This test fails at compilation with Assertion `ExitCount !=
SE.getCouldNotCompute() && "Invalid loop count"'
in 'Loop Vectorization'
================= nice.c ==============
unsigned int a [192] [192];
int main ()
{
unsigned int i = 0;
unsigned short s = 0;
unsigned char c = 0;
goo(& i);
for (s = i; s <= 63; s += 1)
{
for (c = s; c > i; c--)
++a[0][0];
}
foo(& s);
return 0;
}
=======================================
>>> clang -v
clang version 6.0.0 (trunk 319020)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...
>>> clang -c -O0 nice.c
>>> clang -c -O2 nice.c
clang-6.0: llvm/lib/Analysis/ScalarEvolutionExpander.cpp:2126: llvm::Value*
llvm::SCEVExpander::generateOverflowCheck(const llvm::SCEVAddRecExpr*,
llvm::Instruction*, bool): Assertion `ExitCount != SE.getCouldNotCompute() &&
"Invalid loop count"' failed.
#0 0x00000000040b3d7d llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x00000000040b3e0e PrintStackTraceSignalHandler(void*)
llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x00000000040b22fa llvm::sys::RunSignalHandlers()
llvm/lib/Support/Signals.cpp:49:0
#3 0x00000000040b3715 SignalHandler(int)
llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007fbb7b590100 __restore_rt (/lib64/libpthread.so.0+0xf100)
#5 0x00007fbb7a1885f7 __GI_raise (/lib64/libc.so.6+0x355f7)
#6 0x00007fbb7a189ce8 __GI_abort (/lib64/libc.so.6+0x36ce8)
#7 0x00007fbb7a181566 __assert_fail_base (/lib64/libc.so.6+0x2e566)
#8 0x00007fbb7a181612 (/lib64/libc.so.6+0x2e612)
#9 0x00000000033dae58
llvm::SCEVExpander::generateOverflowCheck(llvm::SCEVAddRecExpr const*,
llvm::Instruction*, bool) llvm/lib/Analysis/ScalarEvolutionExpander.cpp:2128:0
#10 0x00000000033db77d
llvm::SCEVExpander::expandWrapPredicate(llvm::SCEVWrapPredicate const*,
llvm::Instruction*) llvm/lib/Analysis/ScalarEvolutionExpander.cpp:2209:0
#11 0x00000000033dac75
llvm::SCEVExpander::expandCodeForPredicate(llvm::SCEVPredicate const*,
llvm::Instruction*) llvm/lib/Analysis/ScalarEvolutionExpander.cpp:2101:0
#12 0x00000000033db8c4
llvm::SCEVExpander::expandUnionPredicate(llvm::SCEVUnionPredicate const*,
llvm::Instruction*) llvm/lib/Analysis/ScalarEvolutionExpander.cpp:2234:0
#13 0x00000000033dac28
llvm::SCEVExpander::expandCodeForPredicate(llvm::SCEVPredicate const*,
llvm::Instruction*) llvm/lib/Analysis/ScalarEvolutionExpander.cpp:2096:0
#14 0x00000000041e0307 llvm::InnerLoopVectorizer::emitSCEVChecks(llvm::Loop*,
llvm::BasicBlock*) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3473:0
#15 0x00000000041e0a10
llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton()
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3623:0
#16 0x00000000041f4197
llvm::LoopVectorizationPlanner::executePlan(llvm::InnerLoopVectorizer&,
llvm::DominatorTree*) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7561:0
#17 0x00000000041faca5 llvm::LoopVectorizePass::processLoop(llvm::Loop*)
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8926:0
#18 0x00000000041fb15e llvm::LoopVectorizePass::runImpl(llvm::Function&,
llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&,
llvm::DominatorTree&, llvm::BlockFrequencyInfo&, llvm::TargetLibraryInfo*,
llvm::DemandedBits&, llvm::AAResults&, llvm::AssumptionCache&,
std::function<llvm::LoopAccessInfo const& (llvm::Loop&)>&,
llvm::OptimizationRemarkEmitter&)
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9007:0
#19 0x00000000041db6fc (anonymous
namespace)::LoopVectorize::runOnFunction(llvm::Function&)
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2493:0
#20 0x00000000039a29c8 llvm::FPPassManager::runOnFunction(llvm::Function&)
llvm/lib/IR/LegacyPassManager.cpp:1514:0
#21 0x00000000039a2b5b llvm::FPPassManager::runOnModule(llvm::Module&)
llvm/lib/IR/LegacyPassManager.cpp:1535:0
#22 0x00000000039a2ee7 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
llvm/lib/IR/LegacyPassManager.cpp:1591:0
#23 0x00000000039a35d8 llvm::legacy::PassManagerImpl::run(llvm::Module&)
llvm/lib/IR/LegacyPassManager.cpp:1694:0
#24 0x00000000039a3819 llvm::legacy::PassManager::run(llvm::Module&)
llvm/lib/IR/LegacyPassManager.cpp:1726:0
#25 0x0000000004353435 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:790:0
#26 0x0000000004355bb4 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1161:0
#27 0x0000000004e79f0f
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:294:0
#28 0x0000000005b094d0 clang::ParseAST(clang::Sema&, bool, bool)
llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#29 0x0000000004993c62 clang::ASTFrontendAction::ExecuteAction()
llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#30 0x0000000004e77fc6 clang::CodeGenAction::ExecuteAction()
llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#31 0x00000000049936a3 clang::FrontendAction::Execute()
llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#32 0x00000000049353b8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#33 0x0000000004acbb02
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#34 0x00000000020adf4a cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#35 0x00000000020a3c66 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) llvm/tools/clang/tools/driver/driver.cpp:309:0
#36 0x00000000020a48ef main llvm/tools/clang/tools/driver/driver.cpp:388:0
#37 0x00007fbb7a174b15 __libc_start_main (/lib64/libc.so.6+0x21b15)
#38 0x00000000020a14e9 _start (build/bin/clang-6.0+0x20a14e9)
Stack dump:
0. Program arguments: build/bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name nice.c
-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 test_dir/nice.gcno -resource-dir build/lib/clang/6.0.0
-internal-isystem /usr/local/include -internal-isystem
build/lib/clang/6.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir test_dir
-ferror-limit 19 -fmessage-length 189 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o nice.o -x c nice.c
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'Function Pass Manager' on module 'nice.c'.
4. Running pass 'Loop Vectorization' on function '@main'
clang-6.0: error: unable to execute command: Aborted
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 319020)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: build/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/nice-014d31.c
clang-6.0: note: diagnostic msg: /tmp/nice-014d31.sh
clang-6.0: note: diagnostic msg:
********************
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171127/030135a9/attachment-0001.html>
More information about the llvm-bugs
mailing list