[llvm-bugs] [Bug 42580] New: missed optimization leading to compiletime assert with address sanitizer
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Jul 11 03:01:33 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=42580
Bug ID: 42580
Summary: missed optimization leading to compiletime assert with
address sanitizer
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: arnd at linaro.org
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
neeilans at live.com, richard-llvm at metafoo.co.uk
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 https://godbolt.org/z/cPrkv4
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190711/1d9167d7/attachment.html>
More information about the llvm-bugs
mailing list