[llvm-bugs] [Bug 39056] New: clang miscompiles with "-newgvn" at -O2 on valid code

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 23 15:19:41 PDT 2018


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

            Bug ID: 39056
           Summary: clang miscompiles with "-newgvn" at -O2 on valid code
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: helloqirun at gmail.com
                CC: llvm-bugs at lists.llvm.org

clang-r329389: first working build
clang-r329395: next failing build







$ clang-trunk -v
clang version 8.0.0 (trunk 342833)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

$ clang-trunk abc.c ; ./a.out
0
0
1
0
0
0
$ clang-trunk -mllvm -enable-newgvn  -O2 abc.c ; ./a.out
0
0
0
0
0
0
$ cat abc.c
int printf(const char *, ...);
volatile int a, d, f;
short b;
char c[6][1];
char e;
int main() {
  int g = 7;
  for (; d <= 1; d++) {
    b = e = g || b;
    c[2][0] = e;
    a;
    g = 0;
  }
  for (; f < 6; f++)
    printf("%d\n", c[f][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/20180923/00358d03/attachment.html>


More information about the llvm-bugs mailing list