[llvm-bugs] [Bug 38795] New: clang crashes at -O1 in 32-bit mode while running pass 'Greedy Register Allocator': Assertion `SA->getUseBlocks().size() == 1 && "Not a local interval"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 31 12:34:34 PDT 2018


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

            Bug ID: 38795
           Summary: clang crashes at -O1 in 32-bit mode while running pass
                    'Greedy Register Allocator': Assertion
                    `SA->getUseBlocks().size() == 1 && "Not a local
                    interval"' 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

$ clangpolly -v
clang version 8.0.0 (http://llvm.org/git/clang.git
b9ef8cb5d0a5501643befcdcf6bef0a3dfa9e205) (llvm/trunk 341010)
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 -m32 -O0 -c small.c
$ 
$ clangpolly -m32 -O1 -c small.c
clang-6.0:
/home/su/software/tmp/polly/llvm/lib/CodeGen/RegAllocGreedy.cpp:2191: unsigned
int {anonymous}::RAGreedy::tryLocalSplit(llvm::LiveInterval&,
llvm::AllocationOrder&, llvm::SmallVectorImpl<unsigned int>&): Assertion
`SA->getUseBlocks().size() == 1 && "Not a local interval"' failed.
Stack dump:
0.      Program arguments: /home/su/software/tmp/polly/llvm_build/bin/clang-6.0
-cc1 -triple i386-unknown-linux-gnu -emit-obj -disable-free -main-file-name
small.c -mrelocation-model static -mthread-model posix -fmath-errno
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu pentium4
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer
-coverage-notes-file
/home/su/specres/good/20180824-clangpolly-m32-O3-build-095030/delta/small.gcno
-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 /include -internal-externc-isystem /usr/include -O1
-fdebug-compilation-dir
/home/su/specres/good/20180824-clangpolly-m32-O3-build-095030/delta
-ferror-limit 19 -fmessage-length 108 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o small.o -x c small.c -faddrsig 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'small.c'.
4.      Running pass 'Greedy Register Allocator' on function '@fn'
#0 0x000000000267e8ea llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:494:0
#1 0x000000000267ceea llvm::sys::RunSignalHandlers()
/home/su/software/tmp/polly/llvm/lib/Support/Signals.cpp:67:0
#2 0x000000000267d019 SignalHandler(int)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:353:0
#3 0x00007f0f25289330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f0f24071c37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f0f24075028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f0f2406abf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f0f2406aca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x000000000208e26e (anonymous
namespace)::RAGreedy::tryLocalSplit(llvm::LiveInterval&,
llvm::AllocationOrder&, llvm::SmallVectorImpl<unsigned int>&)
/home/su/software/tmp/polly/llvm/lib/CodeGen/RegAllocGreedy.cpp:2373:0
#9 0x0000000002094db3 trySplit
/home/su/software/tmp/polly/llvm/lib/CodeGen/RegAllocGreedy.cpp:2428:0
#10 0x0000000002094db3 (anonymous
namespace)::RAGreedy::selectOrSplitImpl(llvm::LiveInterval&,
llvm::SmallVectorImpl<unsigned int>&, llvm::SmallSet<unsigned int, 16u,
std::less<unsigned int> >&, unsigned int)
/home/su/software/tmp/polly/llvm/lib/CodeGen/RegAllocGreedy.cpp:3052:0
#11 0x0000000002096e87 (anonymous
namespace)::RAGreedy::selectOrSplit(llvm::LiveInterval&,
llvm::SmallVectorImpl<unsigned int>&)
/home/su/software/tmp/polly/llvm/lib/CodeGen/RegAllocGreedy.cpp:2733:0
#12 0x00000000020cd5de llvm::RegAllocBase::allocatePhysRegs()
/home/su/software/tmp/polly/llvm/lib/CodeGen/RegAllocBase.cpp:115:0
#13 0x000000000208f7e9 llvm::SmallVectorBase::size() const
/home/su/software/tmp/polly/llvm/include/llvm/ADT/SmallVector.h:53:0
#14 0x000000000208f7e9 llvm::SmallVectorTemplateCommon<llvm::LiveInterval*,
void>::end()
/home/su/software/tmp/polly/llvm/include/llvm/ADT/SmallVector.h:133:0
#15 0x000000000208f7e9 llvm::SetVector<llvm::LiveInterval*,
llvm::SmallVector<llvm::LiveInterval*, 8u>,
llvm::SmallDenseSet<llvm::LiveInterval*, 8u,
llvm::DenseMapInfo<llvm::LiveInterval*> > >::end()
/home/su/software/tmp/polly/llvm/include/llvm/ADT/SetVector.h:94:0
#16 0x000000000208f7e9 tryHintsRecoloring
/home/su/software/tmp/polly/llvm/lib/CodeGen/RegAllocGreedy.cpp:2977:0
#17 0x000000000208f7e9 (anonymous
namespace)::RAGreedy::runOnMachineFunction(llvm::MachineFunction&)
/home/su/software/tmp/polly/llvm/lib/CodeGen/RegAllocGreedy.cpp:3208:0
#18 0x0000000001e6d075
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/su/software/tmp/polly/llvm/lib/CodeGen/MachineFunctionPass.cpp:61:0
#19 0x00000000021a7077 llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1529:0
#20 0x00000000021a729c llvm::FPPassManager::runOnModule(llvm::Module&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1552:0
#21 0x00000000021a7848 runOnModule
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1612:0
#22 0x00000000021a7848 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1716:0
#23 0x000000000284a9d0 ~PrettyStackTraceString
/home/su/software/tmp/polly/llvm/include/llvm/Support/PrettyStackTrace.h:52:0
#24 0x000000000284a9d0 (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/tools/clang/lib/CodeGen/BackendUtil.cpp:850:0
#25 0x000000000284beef ~unique_ptr /usr/include/c++/4.9/bits/unique_ptr.h:235:0
#26 0x000000000284beef 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/tools/clang/lib/CodeGen/BackendUtil.cpp:1273:0
#27 0x00000000030e40fc ~unique_ptr /usr/include/c++/4.9/bits/unique_ptr.h:235:0
#28 0x00000000030e40fc
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:295:0
#29 0x000000000364700e clang::ParseAST(clang::Sema&, bool, bool)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/ParseAST.cpp:170:0
#30 0x00000000030e3580 clang::CodeGenAction::ExecuteAction()
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1045:0
#31 0x0000000002c7b316 clang::FrontendAction::Execute()
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:910:0
#32 0x0000000002c4d37e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:962:0
#33 0x0000000002d1c631
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:257:0
#34 0x0000000000e5bd40 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/cc1_main.cpp:218:0
#35 0x0000000000dd5575 ExecuteCC1Tool
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:310:0
#36 0x0000000000dd5575 main
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:382:0
#37 0x00007f0f2405cf45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#38 0x0000000000e577e9 _start
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0xe577e9)
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
b9ef8cb5d0a5501643befcdcf6bef0a3dfa9e205) (llvm/trunk 341010)
Target: i386-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-52ebfb.c
clang-6: note: diagnostic msg: /tmp/small-52ebfb.sh
clang-6: note: diagnostic msg: 

********************
$ 


-----------------------------------------------


int printf (const char *, ...);

int a, b, e, h;
char c, g;
short d;
long long f;

void fn ()
{
  unsigned char k;
  short l;
  int m, n = 1, i;
  long o;
  for (;; h++)
    {
      if (c || k > 8)
        {
          printf ("%lld\n", f);
          break;
        }
      char p = k;
      k = m;
      short j = m = m / a;
    ac:
      h = l;
      l = a;
      if (j)
        goto ac;
      if (p < 9)
        {
          printf ("%lld\n", (long long) d);
          if (a)
            break;
          p = b >> ~k;
          continue;
        }
      int q = g;
    ae:
      o = c;
      if (b)
        goto af;
      if (q)
        continue;
      if (p)
        printf ("%lld\n", (long long) e);
    }
  for (; i; i++)
    {
    af:
      if (c)
        continue;
      if (o)
        printf ("%lld\n", (long long) fn);
      break;
    }
ag:
  for (; n; n = 9)
    if (m)
      goto ae;
  goto ag;
}

-- 
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/20180831/eda510ec/attachment-0001.html>


More information about the llvm-bugs mailing list