<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 --- - Inconsistent issue of the `ud2` instruction with clang++ -O0"
href="http://llvm.org/bugs/show_bug.cgi?id=16688">16688</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Inconsistent issue of the `ud2` instruction with clang++ -O0
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>i@maskray.me
</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>`clang++ -O0` will issue a `ud2` instruction at the bottom of `f` while other
combinations of optimization flags and options for `clang++/clang` do not.
a.c:
int f() {}
int main() { f(); }
╰─% clang++ -w a.c && ./a.out
[1] 20275 illegal hardware instruction (core dumped) ./a.out
╭─ray @ lap >>= /tmp
╰─[$: 132] % clang -w a.c && ./a.out
╭─ray @ lap >>= /tmp
╰─% clang++ -w -O1 a.c && ./a.out
[1] 20334 segmentation fault (core dumped) ./a.out
╭─ray @ lap >>= /tmp
╰─[$: 139] % clang -w -O1 a.c && ./a.out
╭─ray @ lap >>= /tmp
╰─% clang++ -w -O2 a.c && ./a.out
[1] 20395 segmentation fault (core dumped) ./a.out
╭─ray @ lap >>= /tmp
╰─[$: 139] % clang -w -O2 a.c && ./a.out</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>