[llvm-bugs] [Bug 47292] New: ICE in polly with -O3

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Aug 23 14:11:21 PDT 2020


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

            Bug ID: 47292
           Summary: ICE in polly with -O3
           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

The error is non-deterministic. The crash backtrace varies a lot from run to
run.

>$ clang++ -mllvm -polly -O3 -c func.cpp

clang++: llvm-trunk/polly/include/polly/ScopInfo.h:1387: llvm::Loop*
polly::ScopStmt::getSurroundingLoop() const: Assertion `!isCopyStmt() && "No
surrounding loop for artificially created statements"' failed.
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 -O3 -c func.cpp 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module 'func.cpp'.
4.      Running pass 'Region Pass Manager' on function
'@_Z4testxatjshxbaPtPA2_x'
5.      Running pass 'Polly - Simplify' on basic block '%entry.split'
 #0 0x00005600b983e95e llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/clang-12+0x1e1095e)
 #1 0x00005600b983c6c4 llvm::sys::RunSignalHandlers() (/clang-12+0x1e0e6c4)
 #2 0x00005600b983c941 llvm::sys::CleanupOnSignal(unsigned long)
(/clang-12+0x1e0e941)
 #3 0x00005600b97aa988 CrashRecoverySignalHandler(int) (/clang-12+0x1d7c988)
 #4 0x00007f6d14d223c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #5 0x00007f6d147ae18b raise
/build/glibc-YYA7BZ/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #6 0x00007f6d1478d859 abort /build/glibc-YYA7BZ/glibc-2.31/stdlib/abort.c:81:7
 #7 0x00007f6d1478d729 get_sysdep_segment_value
/build/glibc-YYA7BZ/glibc-2.31/intl/loadmsgcat.c:509:8
 #8 0x00007f6d1478d729 _nl_load_domain
/build/glibc-YYA7BZ/glibc-2.31/intl/loadmsgcat.c:970:34
 #9 0x00007f6d1479ef36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
#10 0x00005600ba93353f polly::markReachable(polly::Scop*, llvm::LoopInfo*,
llvm::DenseSet<polly::VirtualInstruction,
llvm::DenseMapInfo<polly::VirtualInstruction> >&,
llvm::DenseSet<polly::MemoryAccess*, llvm::DenseMapInfo<polly::MemoryAccess*>
>&, polly::ScopStmt*) (/clang-12+0x2f0553f)
#11 0x00005600ba8721e3 (anonymous
namespace)::Simplify::markAndSweep(llvm::LoopInfo*) (/clang-12+0x2e441e3)
#12 0x00005600ba875be8 (anonymous namespace)::Simplify::runOnScop(polly::Scop&)
(/clang-12+0x2e47be8)
#13 0x00005600b8a5c170 llvm::RGPassManager::runOnFunction(llvm::Function&)
(/clang-12+0x102e170)
#14 0x00005600b9174301 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/clang-12+0x1746301)
#15 0x00005600b91749f9 llvm::FPPassManager::runOnModule(llvm::Module&)
(/clang-12+0x17469f9)
#16 0x00005600b917349c llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/clang-12+0x174549c)
#17 0x00005600b9af4109 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) (/clang-12+0x20c6109)
#18 0x00005600b9af5bf5 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> >) (/clang-12+0x20c7bf5)
#19 0x00005600ba7d9891
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/clang-12+0x2dab891)
#20 0x00005600bb91b5a9 clang::ParseAST(clang::Sema&, bool, bool)
(/clang-12+0x3eed5a9)
#21 0x00005600ba7d82d8 clang::CodeGenAction::ExecuteAction()
(/clang-12+0x2daa2d8)
#22 0x00005600ba124a59 clang::FrontendAction::Execute() (/clang-12+0x26f6a59)
#23 0x00005600ba0db176
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/clang-12+0x26ad176)
#24 0x00005600ba1f8690
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/clang-12+0x27ca690)
#25 0x00005600b85fe296 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/clang-12+0xbd0296)
#26 0x00005600b85fb5e8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/clang-12+0xbcd5e8)
#27 0x00005600b9f9a919 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) (/clang-12+0x256c919)
#28 0x00005600b97aab0c
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/clang-12+0x1d7cb0c)
#29 0x00005600b9f9b236
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) (/clang-12+0x256d236)
#30 0x00005600b9f71e1c
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (/clang-12+0x2543e1c)
#31 0x00005600b9f72756
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/clang-12+0x2544756)
#32 0x00005600b9f7be49
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/clang-12+0x254de49)
#33 0x00005600b85782f9 main (/clang-12+0xb4a2f9)
#34 0x00007f6d1478f0b3 __libc_start_main
/build/glibc-YYA7BZ/glibc-2.31/csu/../csu/libc-start.c:342:3
#35 0x00005600b85fb13e _start (/clang-12+0xbcd13e)
clang-12: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 12.0.0 (https://github.com/llvm/llvm-project.git
51a82828fb291fc8f7768711c4b769157d5f0227)
Target: x86_64-unknown-linux-gnu
Thread model: posix


Reproducer:
extern char var_20;
extern int var_27;
char a;

void test(long long b, signed char c, unsigned short p3, unsigned d, 
          bool e, signed char i, unsigned short j[],
          long long k[][2]) {
  for (short f = b; f < (unsigned char)i; f += 1)
    var_20 = j[f] = e;
  for (unsigned l = i - 4294967181; l < 4; l++) {
    for (bool g = c; g < 1; g += p3)
      var_27 = k[l][g];
    for (int h = d; h; h = 0)
      a = 0;
  }
}


clang version 12.0.0 (https://github.com/llvm/llvm-project.git
51a82828fb291fc8f7768711c4b769157d5f0227)

-- 
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/20200823/8bc45f12/attachment-0001.html>


More information about the llvm-bugs mailing list