<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - opt crashes with "opt -gvn -inline -slp-vectorizer -adce -gvn-hoist -sroa": Assertion `UBB == DBB' failed"
   href="https://bugs.llvm.org/show_bug.cgi?id=34461">34461</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt crashes with "opt -gvn -inline -slp-vectorizer -adce -gvn-hoist -sroa": Assertion `UBB == DBB' failed
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>su@cs.ucdavis.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ clang -v
clang version 6.0.0 (trunk 312462)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/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

$ clang -O3 -mllvm -disable-llvm-optzns -w -c -emit-llvm -o small.bc small.c
$ opt -gvn -inline -slp-vectorizer -adce -gvn-hoist -sroa -o small-opt.bc
small.bc
opt:
/tmp/llvm-builder/llvm-source-trunk/lib/Transforms/Scalar/GVNHoist.cpp:526:
bool llvm::GVNHoist::safeToHoistLdSt(const llvm::Instruction*, const
llvm::Instruction*, llvm::MemoryUseOrDef*, llvm::GVNHoist::InsKind, int&):
Assertion `UBB == DBB' failed.
#0 0x0000000001f3031a (opt+0x1f3031a)
#1 0x0000000001f2e4ae (opt+0x1f2e4ae)
#2 0x0000000001f2e610 (opt+0x1f2e610)
#3 0x00007fbc9195b330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fbc90743c37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fbc90747028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fbc9073cbf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fbc9073cca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0000000001d38039 (opt+0x1d38039)
#9 0x0000000001d38879 (opt+0x1d38879)
#10 0x0000000001d38cfb (opt+0x1d38cfb)
#11 0x0000000001d39b0d (opt+0x1d39b0d)
#12 0x0000000001d3a063 (opt+0x1d3a063)
#13 0x0000000001d3a464 (opt+0x1d3a464)
#14 0x0000000001a51963 (opt+0x1a51963)
#15 0x0000000001496626 (opt+0x1496626)
#16 0x0000000001a5227a (opt+0x1a5227a)
#17 0x00000000007fcfb7 (opt+0x7fcfb7)
#18 0x00007fbc9072ef45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#19 0x0000000000860c6a (opt+0x860c6a)
Stack dump:
0.      Program arguments: opt -gvn -inline -slp-vectorizer -adce -gvn-hoist
-sroa -o small-opt.bc small.bc 
1.      Running pass 'CallGraph Pass Manager' on module 'small.bc'.
2.      Running pass 'Early GVN Hoisting of Expressions' on function '@bj'
Aborted (core dumped)



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


long m, d, e, r, s, u, v, w;
int a, g, h, j, o, p, q, t, x, y, ab, ac;
char c, i, k, n, z;
short f, l;
unsigned ae;

char af (int i) { return 0; }
char ag (int ah) { return 0; }
void ai (int i, ...) {}
char aj (int ah) { return 0; }
void ak () {}
short al (int ah) { return 0; }
int am (int i, int j) { return 0; }
int an (int i) { return 0; }
long ao (long ah, long ap) { return 0; }
long aq (int ah) {  return !ah || m && m % ah; }
void ar () {}
char as (int i) { return 0; }
char at (int i) { return 0; }
short au () { return 0; }
short av (short ah, short ap) { return 0; }
short aw (int i) { return 0; }
short ax (int i) { return i; }
int ay (int i, int j) { return 0; }
long az (long ah, long ap) { return 0; }

static long ba (int ah)
{
  int bb, bc, bd;
  short be;
  if (k)
    {
      int bf;
      short bg;
      n = 0;
      while (n)
        {
          int b = bf;
          aw (ah) >= ah;
          -1L >= ae && (ah == ah, ah);
          ak ();
          if (ax (ah))
            {
              o = c ^ ah ^ f;
              char b = a;
              int bh = ao ((bg = bd | af (i)) ^ (bb = bf = s | ay (an (h),
!j)), j);
              b = r & j;
              bc = x;
              k = as (av (aj (j ^ e), bc)) != v;
              bh = am (an (k) != be > j, c);
              g = u;
              ac = u ^ at (al (x));
              bf = 0;
              av (az (bg, c) != e, 1) && 4073709551615;
            }
          else
            {
              while (1) 
                {
                  if (ah)
                    break;
                  return c;
                }
              break;
            }
        }
      while (c)
        {
          int bi;
          be = be || q && q / 4;
          if (d && bb)
            break;
          (a || aq (bf) | ah) && y < ah ^ ah;
        }
      ah > ah;
      a && bg && (ab = bg);
      ah += bc;
      ah = ah;
    }
  else
    {
      ar ();
      af (ah);
      ai (z && ah, ah);
    }
  return p;
}

void bj ()
{
  while (l)
    ;
  d = ag (ba (c));
  !r || m && m % r;
  if (a)
    for (; t; t = au ())
      while (w)
        ;
  f = v;
  al (0);
  e = v;
}

int main ()
{
  bj (); 
  return 0;
}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>