<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 - After r313012, Assertion failed: (ExitCount != SE.getCouldNotCompute() && "Invalid loop count"), function generateOverflowCheck, file lib/Analysis/ScalarEvolutionExpander.cpp, line 2126."
   href="https://bugs.llvm.org/show_bug.cgi?id=36032">36032</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After r313012, Assertion failed: (ExitCount != SE.getCouldNotCompute() && "Invalid loop count"), function generateOverflowCheck, file lib/Analysis/ScalarEvolutionExpander.cpp, line 2126.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>release blocker
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>As reported in <a href="https://bugs.freebsd.org/225345">https://bugs.freebsd.org/225345</a>, building the FreeBSD
games/scummvm port for AArch64 with clang 6.0.0 results in an assertion:

Assertion failed: (ExitCount != SE.getCouldNotCompute() && "Invalid loop
count"), function generateOverflowCheck, file
/usr/local/poudriere/jails/head-arm64/usr/src/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp,
line 2152.

This assertion still occurs with trunk r322755, and bisection shows it has
regressed with <a href="https://reviews.llvm.org/rL313012">https://reviews.llvm.org/rL313012</a> ("[LAA] Allow more run-time
alias checks by coercing pointer expressions to AddRecExprs") by Silviu
Baranga.

Minimized test case:

// clang -cc1 -triple aarch64-- -S -O1 -vectorize-loops graphics-minimized.cpp
struct {
  void *a();
} b;
char c[6];
void d() {
  unsigned char *e = (unsigned char *)b.a();
  unsigned short f;
  for (;;) {
    for (unsigned g; g < 4; g++)
      e[g] = c[g + f];
    f += 4;
  }
}

Note that -vectorize-loops is essential for reproducing the assertion.</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>