https://bugs.llvm.org/show_bug.cgi?id=51531
Bug ID: 51531
Summary: wrong code at -O3 on x86_64-linux-gnu
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: LLVM Codegen
Assignee: unassignedclangb...@nondot.org
Reporter: qrzh...@gatech.edu
CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
richard-l...@metafoo.co.uk
It appears to be a recent regression.
$ clang-trunk -v
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
4f5ba46e162eec32a9f9e2a725e6422281913043)
$ clang-trunk abc.c ; ./a.out
0
$ clang-trunk -O2 abc.c ; ./a.out
$ cat abc.c
int a, c, d;
char e, f;
char(g)(char h, char i) { return i == 0 || h == -128 && i == 1 ? h : h % i; }
char k() {
int j;
d = 3;
for (;; d--)
for (;;) {
short b = g(d, e | d);
j = !b + 1;
f = (1 == b) * j;
c = b;
if (d)
break;
return 1;
}
}
int main() {
k();
printf("%X\n", a);
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs