<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 - compile-time explosion with assumes at -O2 and -Os"
   href="https://bugs.llvm.org/show_bug.cgi?id=49541">49541</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>compile-time explosion with assumes at -O2 and -Os
          </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>normal
          </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>haoxintu@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi, all.

This code, small.c, is a valid program but makes Clang trunk hung on at compile
time at -O2 and -Os. Note that this issue also occurs in recently released
versions of clang, e.g., clang-10, clang-11.

$cat small.c
#include <stdint.h>
int a;
void b(int c) {
  int32_t *d = a;
  uint64_t e;
  int8_t f = 4;
  uint16_t g;
  if (0)
  j:
    if (e <= (*d *= a))
      goto j;
i:
  if (c ? g %= f : *d)
    goto i;
  goto j;
}

$clang -O2 -w small.c (or -Os)
//endless compiling

$clang -v
clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project">https://github.com/llvm/llvm-project</a>
590ac0a26af4c9f63d5564be8c13b12d409a7fd9)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/haoxin/haoxin-data/dut-research/compilers/llvm-project/build-20210310/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Selected multilib: .;@m64

Thanks,
Haoxin</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>