[llvm-bugs] [Bug 34093] New: wrong code with "-O3 -mllvm -enable-newgvn" in both 32-bit and 64-bit mode on x86_64-linux-gnu
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Aug 6 18:37:16 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=34093
Bug ID: 34093
Summary: wrong code with "-O3 -mllvm -enable-newgvn" in both
32-bit and 64-bit mode on x86_64-linux-gnu
Product: clang
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: chengniansun at gmail.com
CC: llvm-bugs at lists.llvm.org
$ clang-trunk -v
clang version 6.0.0 (trunk 310206)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.2
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ clang-trunk -mllvm -enable-newgvn -m32 -O3 -w small.c ; ./a.out
5
$ clang-trunk -m32 -O3 -w small.c ; ./a.out
0
$ cat small.c
int printf(const char *, ...);
int a, b, c, d = 5, e, f, g, h, i, j, k;
short l;
static unsigned fn1(p1) {
int m = 0;
a = k;
j = 7;
for (; j >= 0; j--) {
l = j * 7081;
if (l *((m ^= g | 1) == a)) {
e &= (short)m &(d = i ^= d && 5);
for (; f; f++)
for (; h; h++)
;
} else if (c)
return p1;
a |= p1;
}
}
int main() {
for (;;) {
fn1(b);
break;
}
printf("%d\n", d);
return 0;
}
$
--
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/20170807/889adad1/attachment.html>
More information about the llvm-bugs
mailing list