<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:isanbard@gmail.com" title="Bill Wendling <isanbard@gmail.com>"> <span class="fn">Bill Wendling</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - clang crashes on valid code at -O0 with -ftrapv (affecting all clang versions)"
href="http://llvm.org/bugs/show_bug.cgi?id=18363">bug 18363</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>REOPENED
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>FIXED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - clang crashes on valid code at -O0 with -ftrapv (affecting all clang versions)"
href="http://llvm.org/bugs/show_bug.cgi?id=18363#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - clang crashes on valid code at -O0 with -ftrapv (affecting all clang versions)"
href="http://llvm.org/bugs/show_bug.cgi?id=18363">bug 18363</a>
from <span class="vcard"><a class="email" href="mailto:isanbard@gmail.com" title="Bill Wendling <isanbard@gmail.com>"> <span class="fn">Bill Wendling</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=18363#c2">comment #2</a>)
<span class="quote">> Bill, I don't think that this has been fixed really. The crash is indeed
> gone, but the inconsistent behavior doesn't seem desired --- the code is
> rejected at -O0, but accepted at -O1 and above.
>
> Please see below:
>
> $ clang-trunk -v
> clang version 3.5 (trunk 198876)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
> Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.6
> Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
> Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
> Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.3
> Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
> $
> $ clang-trunk -O0 -ftrapv -c small.c
> error: argument to '__builtin_return_address' must be a constant integer
> 1 error generated.
> $
> $ clang-trunk -O1 -ftrapv -c small.c
> $</span >
The documentation explicitly says that it must be a constant integer. You
passed in an expression, which means that it's an error. The fact that it gets
folded at higher optimizations levels is irrelevant.</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>