<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - non-terminating loop at -Os causes clang to hang"
   href="http://llvm.org/bugs/show_bug.cgi?id=15479">15479</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>non-terminating loop at -Os causes clang to hang
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dhazeghi@yahoo.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following code (derived from a test generated by csmith) causes
top-of-trunk clang to get stuck in an infinite loop when compiled at -Os or
higher.  At -O1 or below, the compilation succeeds.  This may be related for
15386 but that bug only triggers at -O2 or higher.

$ clang-trunk -v
clang version 3.3 (trunk 176687)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ clang-trunk -O1 -c crash8.c
$ clang-trunk -Os -c crash8.c
<hangs>
$ cat crash8.c

int a, b;
int fn1 (int p1, unsigned char p2)
{
    return p1 * p2;
}

int fn3();

void fn2 ()
{
    int c;
    for (;;)
    {
        c ^= a &= 1;
        if (fn3 ())
            c = 0;
        else
            b = b;
        c = fn1 (b > 0, c);
    }
}</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>