https://bugs.llvm.org/show_bug.cgi?id=39126
Bug ID: 39126
Summary: wrong code with -disable-licm-promotion
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Program:
a[6];
b = 15, c, d = 11, h;
short e, g;
short *f = &e;
main() {
for (; c < 6; c++)
a[1] = c;
lbl_71:
++d;
h = &h;
g = 1;
if ((*f = d) & 1)
goto lbl_71;
b = a[b ^ e];
printf("checksum = %X\n", b);
}
Runs:
gcc -O1 -march=z10 -o a.out
gcc -O0 -march=z13 -o a.out
gcc -O1 -march=z13 -o a.out
clang -O0 -march=z10 -o a.out
clang -O0 -march=z13 -o a.out
clang -O3 -march=z10 -o a.out
clang -O3 -march=z13 -o a.out
All the above prints 0, while this one prints 5:
clang -O3 -march=z13 -o a.out -mllvm -disable-licm-promotion
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs