<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 --- - very slow compilation at -O3"
   href="http://llvm.org/bugs/show_bug.cgi?id=16639">16639</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>very slow compilation at -O3
          </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>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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>su@cs.ucdavis.edu
          </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 takes much longer to compile at -O3 than at -O2, using the
current clang-trunk, clang 3.3, and clang 3.2 on x86_64-linux in both 32-bit
and 64-bit modes. 


$ clang-trunk -v 
clang version 3.4 (trunk 186424)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ time clang-trunk -m64 -O3 -c small.c
47.09user 0.02system 0:47.15elapsed 99%CPU (0avgtext+0avgdata
53264maxresident)k
0inputs+8outputs (0major+4755minor)pagefaults 0swaps
$ time clang-trunk -m64 -O2 -c small.c
0.13user 0.00system 0:00.14elapsed 98%CPU (0avgtext+0avgdata 53184maxresident)k
0inputs+8outputs (0major+4698minor)pagefaults 0swaps
$ time clang-3.3 -m64 -O3 -c small.c
53.13user 0.01system 0:53.16elapsed 99%CPU (0avgtext+0avgdata
51696maxresident)k
0inputs+8outputs (0major+4592minor)pagefaults 0swaps
$ time clang-3.2 -m64 -O3 -c small.c
51.06user 0.01system 0:51.09elapsed 99%CPU (0avgtext+0avgdata
48992maxresident)k
0inputs+8outputs (0major+4304minor)pagefaults 0swaps
$ time gcc-trunk -m64 -O3 -c small.c
0.04user 0.01system 0:00.06elapsed 88%CPU (0avgtext+0avgdata 44128maxresident)k
0inputs+16outputs (0major+4954minor)pagefaults 0swaps


-------------------------------------------------


int a, *b, c, d, g;

void
foo ()
{
  int e;
  int **f = &b;
  *f = &e;
}

void
bar ()
{
  for (d = 0; d <= 5; d++) {
    for (c = 0; c <= 5; c++) {
      if (g)
    break;
      for (a = 5; a; a--)
    foo ();
    }
  }
}

void
baz ()
{
  for (;;) {
    bar ();
    bar ();
  }
}</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>