https://bugs.llvm.org/show_bug.cgi?id=48057
Bug ID: 48057
Summary: [LoopInterchange] Loops should not interchanged due to
control flow
Product: libraries
Version: trunk
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Loop Optimizer
Assignee: unassignedb...@nondot.org
Reporter: chenge...@huawei.com
CC: llvm-bugs@lists.llvm.org
$ clang -mllvm -enable-loopinterchange=true -O2 reproducer.c -w && ./a.out
0
$ clang -mllvm -enable-loopinterchange=false -O2 reproducer.c -w && ./a.out
5
$ clang -O0 reproducer.c -w && ./a.out
5
reproducer.c:
#include <stdio.h>
char b[][8] = {{}, {}, {}, {}, {5}, {}, 2, 3};
int c, d;
short e;
static char f() {
for (; c <= 7; c++) {
d = 4;
for (; d; d--)
b[d + 2][c] && (e = b[d][0]);
}
}
int main() {
f();
printf("%d\n", e);
}
--
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