[llvm-bugs] [Bug 48113] New: [LoopInterchange] Tightly nested checking issue

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Nov 8 18:17:13 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48113

            Bug ID: 48113
           Summary: [LoopInterchange] Tightly nested checking issue
           Product: libraries
           Version: trunk
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: chengeng5 at huawei.com
                CC: llvm-bugs at lists.llvm.org

$clang -Os -mllvm -enable-loopinterchange=true issue.c && ./a.out
9

clang -Os -mllvm -enable-loopinterchange=false issue.c && ./a.out
3

issue.c:

#include <stdio.h>
char a, d;
int b[][2];
char c[][9];
char *e;
static unsigned f;
short g;
static long h() {
  for (; f <= 2; f++) {
    char *i = &d;
    int j = 0;
    for (; j <= 2; j++)
      b[j][1] = c[j][f];
    ++*i;
    if (a)
      g = *e;
  }
}
int main() {
  h();
  printf("%lX\n", d);
}

-- 
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/20201109/1220cb40/attachment.html>


More information about the llvm-bugs mailing list