[llvm-bugs] [Bug 39497] New: clang crashes on valid code at -O3 on x86_64-linux-gnu: Assertion `!Cost->fol dTailByMasking() && "Cannot check stride when folding tail"' failed
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Oct 30 04:50:00 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=39497
Bug ID: 39497
Summary: clang crashes on valid code at -O3 on
x86_64-linux-gnu: Assertion `!Cost->fol
dTailByMasking() && "Cannot check stride when folding
tail"' failed
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: su at cs.ucdavis.edu
CC: llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk
Tested with trunk revision 345488.
$ clangpolly -v
clang version 8.0.0 (http://llvm.org/git/clang.git
8029b38886dd239769e3501dac21438e16886ce8) (llvm/trunk 345488)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clangpolly -O2 small.c
$
$ clangpolly -O3 small.c
clang-6.0:
/home/su/software/tmp/polly/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2519:
void llvm::InnerLoopVectorizer::emitSCEVChecks(llvm::Loop*, llvm::BasicBlock*):
Assertion `!Cost->foldTailByMasking() && "Cannot check stride when folding
tail"' failed.
Stack dump:
0. Program arguments: /home/su/software/tmp/polly/llvm_build/bin/clang-6.0
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
small.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 -resource-dir
/home/su/software/tmp/polly/llvm_build/lib/clang/8.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/su/software/tmp/polly/llvm_build/lib/clang/8.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-fdebug-compilation-dir
/home/su/specres/good/20181026-clangpolly-m64-O3-build-114556/delta
-ferror-limit 19 -fmessage-length 97 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-026d76.o -x c small.c -faddrsig
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'Function Pass Manager' on module 'small.c'.
4. Running pass 'Loop Vectorization' on function '@main'
#0 0x000000000280907a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x280907a)
#1 0x000000000280771a llvm::sys::RunSignalHandlers()
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x280771a)
#2 0x0000000002807851 SignalHandler(int)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x2807851)
#3 0x00007f39f41e3330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f39f2fcbc37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f39f2fcf028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f39f2fc4bf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f39f2fc4ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x000000000291c2e9 llvm::InnerLoopVectorizer::emitSCEVChecks(llvm::Loop*,
llvm::BasicBlock*)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x291c2e9)
#9 0x000000000292d1c8 llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton()
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x292d1c8)
#10 0x00000000029389e8
llvm::LoopVectorizationPlanner::executePlan(llvm::InnerLoopVectorizer&,
llvm::DominatorTree*)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x29389e8)
#11 0x000000000293f080 llvm::LoopVectorizePass::processLoop(llvm::Loop*)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x293f080)
#12 0x000000000294052c 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&)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x294052c)
#13 0x0000000002940b66 (anonymous
namespace)::LoopVectorize::runOnFunction(llvm::Function&)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x2940b66)
#14 0x00000000022e8292 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x22e8292)
#15 0x00000000022e84dc llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x22e84dc)
#16 0x00000000022e8c06 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x22e8c06)
#17 0x00000000029d8625 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x29d8625)
#18 0x00000000029d9c0f 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> >)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x29d9c0f)
#19 0x00000000032caccc
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x32caccc)
#20 0x00000000038d4895 clang::ParseAST(clang::Sema&, bool, bool)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x38d4895)
#21 0x00000000032ca041 clang::CodeGenAction::ExecuteAction()
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x32ca041)
#22 0x0000000002e33a66 clang::FrontendAction::Execute()
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x2e33a66)
#23 0x0000000002e04576
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x2e04576)
#24 0x0000000002ede094
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x2ede094)
#25 0x0000000000e5d308 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0xe5d308)
#26 0x0000000000dce7b5 main
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0xdce7b5)
#27 0x00007f39f2fb6f45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#28 0x0000000000e581c9 _start
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0xe581c9)
clang-6: error: unable to execute command: Aborted (core dumped)
clang-6: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 8.0.0 (http://llvm.org/git/clang.git
8029b38886dd239769e3501dac21438e16886ce8) (llvm/trunk 345488)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
clang-6: 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: 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: note: diagnostic msg: /tmp/small-75501a.c
clang-6: note: diagnostic msg: /tmp/small-75501a.sh
clang-6: note: diagnostic msg:
********************
$
----------------------------------
int a, b;
int main ()
{
unsigned short d;
while (1)
for (d = 0; d < 4; d += 1)
{
b &= d + 1;
if (!a)
return 0;
}
return 0;
}
--
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/20181030/102331c9/attachment-0001.html>
More information about the llvm-bugs
mailing list