[llvm-bugs] [Bug 34828] New: Assertion in VirtRegRewriter: `toIndex_(n) < storage_.size() && "index out of bounds!"'

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 4 00:21:30 PDT 2017


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

            Bug ID: 34828
           Summary: Assertion in VirtRegRewriter: `toIndex_(n) <
                    storage_.size() && "index out of bounds!"'
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: babokin at gmail.com
                CC: llvm-bugs at lists.llvm.org

clang trunk rev314757, x86_64.

Note that UBSAN switches are required to reproduce.

> cat f.cpp
int a, b, ad, av, l, o, p, q, r, s, m, cl, cm;
short c, am, ap, n, ci;
unsigned d, e, g, h, ak;
unsigned long long f, i;
long j, aj;
unsigned long k, ag;
long *ce;
unsigned *cf;
long long *ch;
short *cn;
int *co;
void t() {
  0 <= *ce;
  if ((unsigned(aj) + (f + -g - e) - d + ag + (unsigned(i) - (27002 + c) + k))
*
      h * 3131423175)
    *cn = s;
  else {
    if ((r || n <= m) <= int((i - int(2 + k)) * j * d * (c * ak)))
      if ((d && *cf) < b)
        ;
      else
        p = l;
    else
      a = i - int(k) && -1609622849 / ci;
    c + ag + k || *ch;
    am = f + -g - c;
  }
  l << q;
  if (ap && av) {
    if (e - c)
      cm = *ce && cl * ad * *co + c && ag + k;
    else
      *ch = 0;
    if (i)
      *co << j - 70807125331817721;
    j - 70807125331817721;
  }
  o = unsigned(aj) + f + -g - d - c + unsigned(i - 27002) - (2 + k) < aj;
}

> clang++ -fsanitize=undefined -fno-sanitize-recover=undefined -w -O2 -c f.cpp
clang-6.0:
/home/dybaboki/llvm/llvm-trunk-20171002/include/llvm/ADT/IndexedMap.h:52:
typename StorageT::const_reference llvm::IndexedMap<unsigned int,
llvm::VirtReg2IndexFunctor>::operator[](llvm::IndexedMap::IndexT) const [T =
unsigned int, ToIndexT = llvm::VirtReg2IndexFunctor]: Assertion `toIndex_(n) <
storage_.size() && "index out of bounds!"' failed.
#0 0x00000000013528ff llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/dybaboki/llvm/bin-trunk-20171002/bin/clang-6.0+0x13528ff)
#1 0x0000000001352c06 SignalHandler(int)
(/home/dybaboki/llvm/bin-trunk-20171002/bin/clang-6.0+0x1352c06)
#2 0x00007f5e3bb9c370 __restore_rt (/lib64/libpthread.so.0+0xf370)
#3 0x00007f5e3a7181d7 __GI_raise (/lib64/libc.so.6+0x351d7)
#4 0x00007f5e3a7198c8 __GI_abort (/lib64/libc.so.6+0x368c8)
#5 0x00007f5e3a711146 __assert_fail_base (/lib64/libc.so.6+0x2e146)
#6 0x00007f5e3a7111f2 (/lib64/libc.so.6+0x2e1f2)
#7 0x0000000000d24206 llvm::LiveIntervals::addKillFlags(llvm::VirtRegMap
const*) (/home/dybaboki/llvm/bin-trunk-20171002/bin/clang-6.0+0xd24206)
#8 0x0000000000cd637d (anonymous
namespace)::VirtRegRewriter::runOnMachineFunction(llvm::MachineFunction&)
(/home/dybaboki/llvm/bin-trunk-20171002/bin/clang-6.0+0xcd637d)
#9 0x0000000000bd84a8 llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/dybaboki/llvm/bin-trunk-20171002/bin/clang-6.0+0xbd84a8)
#10 0x0000000000eeceff llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/dybaboki/llvm/bin-trunk-20171002/bin/clang-6.0+0xeeceff)
#11 0x0000000000eed1c3 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/dybaboki/llvm/bin-trunk-20171002/bin/clang-6.0+0xeed1c3)
#12 0x0000000000eed6a6 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/dybaboki/llvm/bin-trunk-20171002/bin/clang-6.0+0xeed6a6)
<...>

-- 
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/20171004/7621a95e/attachment.html>


More information about the llvm-bugs mailing list