<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 - Infinite recursion in getSCEV -> createSCEV"
   href="https://bugs.llvm.org/show_bug.cgi?id=40799">40799</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Infinite recursion in getSCEV -> createSCEV
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>6.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>Loop Optimizer
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>konstantin.vladimirov@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Reproduction after creduce:

---
int a, b, c, d, e, f, g;
void h() {
  int j = g;
  long *k = h;
  for (; a;)
    ;
  for (; b; b++) {
    c = 0;
    for (; c < 7; c++) {
      d = 2;
      for (; d < 15; d += 2) {
        e = 1;
        for (; e < 12; e += 2) {
          f = 0;
          for (; f < 15; f++) {
            g = 2;
            for (; g < 5; g++)
              *k = a ^ 940 * *k * j;
          }
        }
      }
    }
  }
}
---

Compile with:

clang -w -O2 minimize.c -S

You will see stack trace.

---
#240 0x0000000000cefc70 llvm::ScalarEvolution::createSCEV(llvm::Value*) [clone
.part.1495] (/apps/clang/6.0.0/bin/clang-6.0+0xcefc70)
#241 0x0000000000cf1410 llvm::ScalarEvolution::getSCEV(llvm::Value*)
(/apps/clang/6.0.0/bin/clang-6.0+0xcf1410)
#242 0x0000000000cefc70 llvm::ScalarEvolution::createSCEV(llvm::Value*) [clone
.part.1495] (/apps/clang/6.0.0/bin/clang-6.0+0xcefc70)
#243 0x0000000000cf1410 llvm::ScalarEvolution::getSCEV(llvm::Value*)
(/apps/clang/6.0.0/bin/clang-6.0+0xcf1410)
#244 0x0000000000cefc70 llvm::ScalarEvolution::createSCEV(llvm::Value*) [clone
.part.1495] (/apps/clang/6.0.0/bin/clang-6.0+0xcefc70)
#245 0x0000000000cf1410 llvm::ScalarEvolution::getSCEV(llvm::Value*)
(/apps/clang/6.0.0/bin/clang-6.0+0xcf1410)
#246 0x0000000000cefc70 llvm::ScalarEvolution::createSCEV(llvm::Value*) [clone
.part.1495] (/apps/clang/6.0.0/bin/clang-6.0+0xcefc70)
#247 0x0000000000cf1410 llvm::ScalarEvolution::getSCEV(llvm::Value*)
(/apps/clang/6.0.0/bin/clang-6.0+0xcf1410)
#248 0x0000000000cefc70 llvm::ScalarEvolution::createSCEV(llvm::Value*) [clone
.part.1495] (/apps/clang/6.0.0/bin/clang-6.0+0xcefc70)
#249 0x0000000000cf1410 llvm::ScalarEvolution::getSCEV(llvm::Value*)
(/apps/clang/6.0.0/bin/clang-6.0+0xcf1410)
---

Compiler information:

<span class="quote">> clang -v</span >
clang version 6.0.0 (tags/RELEASE_600/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /apps/clang/6.0.0//bin
Found candidate GCC installation: /usr/lib/gcc/i586-suse-linux/2.95.3
Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.3
Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.3
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64</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>