https://bugs.llvm.org/show_bug.cgi?id=51086
Bug ID: 51086
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-12 works fine.
$ clang-trunk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
20176bc7dd3f431db4c3d59b51a9f53d52190c82)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang-trunk abc.c ; ./a.out
-26
$ clang-trunk -O3 abc.c ; ./a.out
0
$ cat abc.c
int a, b;
static int c = 92;
long d;
short(e)(f) { return f; }
long g() {
short h;
int i = d >= 0;
for (; b > -26; --b) {
if (i)
continue;
for (; i - 30; i--) {
h = a << c;
if (h)
return 7;
}
}
}
int main() {
g();
if (e(0))
c++;
printf("%d\n", b);
}
--
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