[PATCH] D149423: [ValueTracking] Use knownbits interface for determining if `div`/`rem` are safe to speculate
Alexander Kornienko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 9 15:21:16 PDT 2023
alexfh added a comment.
This patch is causing a miscompile:
$ cat q.cc
extern unsigned q();
int main() {
unsigned qq = q();
if (qq == 0) qq = 1;
int rows = 8192 / qq;
if (rows == 0) rows = 1;
return rows;
}
$ cat w.cc
unsigned q() { return 524288; }
$ clang -fsanitize=memory -O2 q.cc w.cc && ./a.out
MemorySanitizer:DEADLYSIGNAL
==885020==ERROR: MemorySanitizer: FPE on unknown address 0x0000002cc0c4 (pc 0x0000002cc0c4 bp 0x000000000001 sp 0x7ffd25df6e50 T885020)
...
Please revert or fix soon. Thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149423/new/
https://reviews.llvm.org/D149423
More information about the llvm-commits
mailing list