<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 - clang crashes at -O3 with both newgvn and polly: Instruction does not dominate all uses!"
   href="https://bugs.llvm.org/show_bug.cgi?id=34687">34687</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang crashes at -O3 with both newgvn and polly: Instruction does not dominate all uses!
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Polly
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>Optimizer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>polly-dev@googlegroups.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>helloqirun@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Unlike <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - crash at -O3 and -O2 in 32-bit mode (Instruction does not dominate all uses! error in backend: Broken function found, compilation aborted!)"
   href="show_bug.cgi?id=32795">Bug 32795</a>, the crash happens in 32-bit mode with both newgvn and polly
enabled.


$ clang-trunk -v
clang version 6.0.0 (trunk 313740) (llvm/trunk 313739)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin


$ clang-trunk -mllvm -polly -mllvm -enable-newgvn -O3 -m32 abc.c
Instruction does not dominate all uses!
  %118 = add <16 x i32> %vec.phi, %116
  %16 = and <16 x i32> %118, <i32 255, i32 255, i32 255, i32 255, i32 255, i32
255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255,
i32 255, i32 255>
Instruction does not dominate all uses!
  %119 = add nuw nsw <16 x i32> %vec.phi94, %117
  %17 = and <16 x i32> %119, <i32 255, i32 255, i32 255, i32 255, i32 255, i32
255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255,
i32 255, i32 255>
fatal error: error in backend: Broken function found, compilation aborted!
clang-6.0: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 6.0.0 (trunk 313740) (llvm/trunk 313739)
Target: i386-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: 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.0: note: diagnostic msg: /tmp/abc-fa66e6.c
clang-6.0: note: diagnostic msg: /tmp/abc-fa66e6.sh
clang-6.0: note: diagnostic msg:

********************



$ cat abc.c
char a, b = 8, i = 0;
long c, g;
short d, h, j;
int e, f;
int *k;
void fn1() {
  long l = c;
  for (; g;) {
  l1:
    for (; l;)
      ;
    if (f)
      goto l1;
    for (; j <= 2; j++) {
      e = b;
      a += (b = 0) || i ? *k %= h : (f || d / h) & (l = j || j / e);
    }
  }
}</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>