<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 -jump-threading -indvars" while running pass 'Induction Variable Simplification'"
   href="https://bugs.llvm.org/show_bug.cgi?id=37827">37827</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt crashes with "opt -gvn -jump-threading -indvars" while running pass 'Induction Variable Simplification'
          </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>Created <span class=""><a href="attachment.cgi?id=20436" name="attach_20436" title="crash triggering LLVM IR">attachment 20436</a> <a href="attachment.cgi?id=20436&action=edit" title="crash triggering LLVM IR">[details]</a></span>
crash triggering LLVM IR

Tested with trunk revision 334906. 

$ clangpolly -v
clang version 7.0.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
c36069cffc57a30a20782bf327a87bed4e48a6c2) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
59cb663e72874dda740aa2b18bf47ba65b32fe9b)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.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.4
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.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.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.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$ clangpolly -O0 -w small.c; ./a.out

$ clangpolly -O3 -mllvm -disable-llvm-optzns -w -c -emit-llvm -o small.bc
small.c
$ optpolly -gvn -jump-threading -indvars -o small-opt.bc small.bc
Stack dump:
0.      Program arguments: optpolly -gvn -jump-threading -indvars -o
small-opt.bc small.bc 
1.      Running pass 'Function Pass Manager' on module 'small.bc'.
2.      Running pass 'Loop Pass Manager' on function '@f'
3.      Running pass 'Induction Variable Simplification' on basic block
'%for.cond'
LLVMSymbolizer: error reading file: No such file or directory
#0 0x00000000020eebca (optpolly+0x20eebca)
#1 0x00000000020ed1cc (optpolly+0x20ed1cc)
#2 0x00000000020ed337 (optpolly+0x20ed337)
#3 0x00007f40d95cc390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x0000000001ac26b4 (optpolly+0x1ac26b4)
#5 0x0000000001ef7824 (optpolly+0x1ef7824)
#6 0x0000000001ef7aa3 (optpolly+0x1ef7aa3)
#7 0x0000000001ef88dd (optpolly+0x1ef88dd)
#8 0x0000000001efbc43 (optpolly+0x1efbc43)
#9 0x0000000001efd615 (optpolly+0x1efd615)
#10 0x0000000001eff9b1 (optpolly+0x1eff9b1)
#11 0x0000000001635c4f (optpolly+0x1635c4f)
#12 0x0000000001b93493 (optpolly+0x1b93493)
#13 0x0000000001b9356c (optpolly+0x1b9356c)
#14 0x0000000001b9303d (optpolly+0x1b9303d)
#15 0x00000000007bfca8 (optpolly+0x7bfca8)
#16 0x00007f40d8329830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#17 0x000000000084fd89 (optpolly+0x84fd89)
Segmentation fault (core dumped)



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


int a, b[3], c, d;

void f ()
{
  for (; d < 1; d++)
    {
      b[d + 2];
      for (c = 0; c == 1; c++)
        while (a)
          (d || 0, d + 2);
    }
}

int main ()
{
  f ();
  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>