<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 - missed optimization leading to compiletime assert with address sanitizer"
href="https://bugs.llvm.org/show_bug.cgi?id=42580">42580</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>missed optimization leading to compiletime assert with address sanitizer
</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>Linux
</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>arnd@linaro.org
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>The current clang-9 prerelease causes one file in the linux kernel to get fail
compilation with an assertion triggering when building with
-sanitize=kernel-address:
void __iwl_err(char *, ...);
int a;
void iwl_fw_dbg_apply_point() {
const char b[] = "WRT ext=%d. Invalid apply point %d for %s\n";
if (a) {
void __compiletime_assert_2790(void);
if (b[sizeof(b) - 2] != '\n')
__compiletime_assert_2790();
}
__iwl_err(0, b);
}
$ clang-9 -O2 -fsanitize=kernel-address -S dbg.i -o- | grep compiletime
callq __compiletime_assert_2790
both clang-8 and gcc-8 pass the assertion here.
See also <a href="https://godbolt.org/z/cPrkv4">https://godbolt.org/z/cPrkv4</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>