<html>
    <head>
      <base href="https://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 --- - Using `__builtin_frame_address(-1)` causes infinite loop."
   href="https://llvm.org/bugs/show_bug.cgi?id=25497">25497</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Using `__builtin_frame_address(-1)` causes infinite loop.
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.7
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>richardross@fb.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=15268" name="attach_15268" title="clang-backtrace">attachment 15268</a> <a href="attachment.cgi?id=15268&action=edit" title="clang-backtrace">[details]</a></span>
clang-backtrace

This simple snippet of code:

    int main() {
       void *x = __builtin_frame_address(-1);
    }

Will cause the compiler to run infinitely, or at least until the systems'
memory limit is reached.

Obviously, __builtin_frame_address(-1) is an invalid operation and undefined
behavior, but there should probably be a better reporting mechanism than to
cause the compiler to hang.

Attached is a stack trace as provided by OSX's activity monitor sampler. Also
tested with latest trunk 3.7, unfortunately the precompiled version has no
symbol information.</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>