[llvm-bugs] [Bug 50109] New: Polly crashes: "Negative unroll factor UNREACHABLE executed at llvm/polly/lib/Transform/ManualOptimizer.cpp:83!"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 23 22:48:01 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50109

            Bug ID: 50109
           Summary: Polly crashes: "Negative unroll factor UNREACHABLE
                    executed at
                    llvm/polly/lib/Transform/ManualOptimizer.cpp:83!"
           Product: Polly
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Optimizer
          Assignee: polly-dev at googlegroups.com
          Reporter: Vsevolod.Livinskij at frtk.ru
                CC: llvm-bugs at lists.llvm.org

Reproducer:

extern char a;
long b;
void e(short f[][5][10]) {
#pragma clang loop unroll(enable)
  for (bool c; c < 1; c += b)
    for (char d = 0; d < (char)b; d++)
      a = f[8][b][d];
}

Error:
>$ clang++ -mllvm -polly -O2 -c func.cpp
Negative unroll factor
UNREACHABLE executed at
llvm/llvm-trunk/polly/lib/Transform/ManualOptimizer.cpp:83!
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: clang++ -mllvm -polly -O2 -c func.cpp
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x000056288afde9d1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(llvm/bin-trunk/bin/clang-13+0x20a99d1)
 #1 0x000056288afdc794 llvm::sys::RunSignalHandlers()
(llvm/bin-trunk/bin/clang-13+0x20a7794)
 #2 0x000056288af3b968 CrashRecoverySignalHandler(int)
CrashRecoveryContext.cpp:0:0
 #3 0x00007fd44f776bb0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14bb0)
 #4 0x00007fd44f2198cb raise ./signal/../sysdeps/unix/sysv/linux/raise.c:50:1
 #5 0x00007fd44f1fe864 abort ./stdlib/abort.c:81:7
 #6 0x000056288af446ee (llvm/bin-trunk/bin/clang-13+0x200f6ee)
 #7 0x000056288c1585c2 polly::ScheduleTreeVisitor<(anonymous
namespace)::SearchTransformVisitor,
void>::visit(isl::noexceptions::schedule_node const&) ManualOptimizer.cpp:0:0
 #8 0x000056288c157dd3 polly::ScheduleTreeVisitor<(anonymous
namespace)::SearchTransformVisitor,
void>::visit(isl::noexceptions::schedule_node const&) ManualOptimizer.cpp:0:0
 #9 0x000056288c157bd3 polly::ScheduleTreeVisitor<(anonymous
namespace)::SearchTransformVisitor,
void>::visit(isl::noexceptions::schedule_node const&) ManualOptimizer.cpp:0:0
#10 0x000056288c158719 polly::applyManualTransformations(polly::Scop*,
isl::noexceptions::schedule) (llvm/bin-trunk/bin/clang-13+0x3223719)
#11 0x000056288c11b488 (anonymous
namespace)::runIslScheduleOptimizer(polly::Scop&,
llvm::function_ref<polly::Dependences const&
(polly::Dependences::AnalysisLevel)>, llvm::TargetTransformInfo*,
isl::noexceptions::schedule&) ScheduleOptimizer.cpp:0:0
#12 0x000056288c120b7f runIslScheduleOptimizerUsingNPM(polly::Scop&,
llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>&,
polly::ScopStandardAnalysisResults&, polly::SPMUpdater&, llvm::raw_ostream*)
(.constprop.0) ScheduleOptimizer.cpp:0:0
#13 0x000056288c12147e polly::IslScheduleOptimizerPass::run(polly::Scop&,
llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>&,
polly::ScopStandardAnalysisResults&, polly::SPMUpdater&)
(llvm/bin-trunk/bin/clang-13+0x31ec47e)
#14 0x000056288c0fc916 llvm::detail::PassModel<polly::Scop,
polly::IslScheduleOptimizerPass, llvm::PreservedAnalyses,
llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>,
polly::ScopStandardAnalysisResults&, polly::SPMUpdater&>::run(polly::Scop&,
llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>&,
polly::ScopStandardAnalysisResults&, polly::SPMUpdater&)
(llvm/bin-trunk/bin/clang-13+0x31c7916)
#15 0x000056288c1c87db llvm::PassManager<polly::Scop,
llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>,
polly::ScopStandardAnalysisResults&, polly::SPMUpdater&>::run(polly::Scop&,
llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>&,
polly::ScopStandardAnalysisResults&, polly::SPMUpdater&)
(llvm/bin-trunk/bin/clang-13+0x32937db)
#16 0x000056288c112e27
polly::FunctionToScopPassAdaptor<llvm::PassManager<polly::Scop,
llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>,
polly::ScopStandardAnalysisResults&, polly::SPMUpdater&>
>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
(llvm/bin-trunk/bin/clang-13+0x31dde27)
#17 0x000056288c113246 llvm::detail::PassModel<llvm::Function,
polly::FunctionToScopPassAdaptor<llvm::PassManager<polly::Scop,
llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>,
polly::ScopStandardAnalysisResults&, polly::SPMUpdater&> >,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>
>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
(llvm/bin-trunk/bin/clang-13+0x31de246)
#18 0x000056288a8d528e llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&) (llvm/bin-trunk/bin/clang-13+0x19a028e)
#19 0x000056288b2c8b16 llvm::detail::PassModel<llvm::Function,
llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>
>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
(llvm/bin-trunk/bin/clang-13+0x2393b16)
#20 0x000056288a8d3d86 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&) (llvm/bin-trunk/bin/clang-13+0x199ed86)
#21 0x000056288b2c9756 llvm::detail::PassModel<llvm::Module,
llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&) (llvm/bin-trunk/bin/clang-13+0x2394756)
#22 0x000056288a8d1e67 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&) (llvm/bin-trunk/bin/clang-13+0x199ce67)
#23 0x000056288b2db521 (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) (.constprop.0)
BackendUtil.cpp:0:0
#24 0x000056288b2de830 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/bin-trunk/bin/clang-13+0x23a9830)
#25 0x000056288c09a398
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(llvm/bin-trunk/bin/clang-13+0x3165398)
#26 0x000056288d074899 clang::ParseAST(clang::Sema&, bool, bool)
(llvm/bin-trunk/bin/clang-13+0x413f899)
#27 0x000056288b9a77d9 clang::FrontendAction::Execute()
(llvm/bin-trunk/bin/clang-13+0x2a727d9)
#28 0x000056288b938dee
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(llvm/bin-trunk/bin/clang-13+0x2a03dee)
#29 0x000056288ba6cd53
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(llvm/bin-trunk/bin/clang-13+0x2b37d53)
#30 0x0000562889c4e5ae cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (llvm/bin-trunk/bin/clang-13+0xd195ae)
#31 0x0000562889c49c98 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#32 0x000056288b7c7d09 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#33 0x000056288af3bafc
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(llvm/bin-trunk/bin/clang-13+0x2006afc)
#34 0x000056288b7c8f3b
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (.part.0) Job.cpp:0:0
#35 0x000056288b79b0dc
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (llvm/bin-trunk/bin/clang-13+0x28660dc)
#36 0x000056288b79bc19
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(llvm/bin-trunk/bin/clang-13+0x2866c19)
#37 0x000056288b7a8419
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(llvm/bin-trunk/bin/clang-13+0x2873419)
#38 0x0000562889bb66f6 main (llvm/bin-trunk/bin/clang-13+0xc816f6)
#39 0x00007fd44f200cb2 __libc_start_main ./csu/../csu/libc-start.c:314:16
#40 0x0000562889c4960e _start (llvm/bin-trunk/bin/clang-13+0xd1460e)
clang-13: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
502f54049d17f5a107f833596fb2c31297a99773)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: llvm/bin-trunk/bin
clang-13: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/func-c36f46.cpp
clang-13: note: diagnostic msg: /tmp/func-c36f46.sh
clang-13: note: diagnostic msg: 

********************

clang version 13.0.0 (https://github.com/llvm/llvm-project.git
502f54049d17f5a107f833596fb2c31297a99773)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: llvm/bin-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

-- 
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/20210424/76cbf78d/attachment.html>


More information about the llvm-bugs mailing list