<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - jump table switch also contains a branch (conditional jump to a first case)"
href="https://bugs.llvm.org/show_bug.cgi?id=41242">41242</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>jump table switch also contains a branch (conditional jump to a first case)
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>7.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>code-quality
</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>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nok.raven@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>int f1();
int f2();
int f3();
int f4();
int f5();
int foo(int i)
{
switch (i) {
case 1: return f1();
case 2: return f2();
case 3: return f3();
case 4: return f4();
case 5: return f5();
}
__builtin_unreachable();
}
The branch conditionally jumps to the first case. This happens for different
architectures, and GCC does not do this.
x86_64 <a href="https://godbolt.org/z/aYDsUR">https://godbolt.org/z/aYDsUR</a>
ARM <a href="https://godbolt.org/z/j4c0Jf">https://godbolt.org/z/j4c0Jf</a></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>