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

            Bug ID: 50906
           Summary: wrong code at -O2 on x86_64-linux-gnu
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: qrzh...@gatech.edu
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

It appears to be a regression in clang-12.

$ clang-trunk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
043ce4e6bdd376ff460d78446d1a6b94c6e0f18c)
Target: x86_64-unknown-linux-gnu
Thread model: posix


$ clang-trunk abc.c ; ./a.out
0


$ clang-trunk -O2 abc.c ; ./a.out
Floating point exception


$ cat abc.c
int a, b, c;
char d[8];
char e;
int(f)(g, h) { return h > 0 && g < 7 / h || h <= 0 && g && h; }
int main() {
  int i = -1L;
  if (b)
    c = i = 0;
  if (f(i, &d[7] == &e)) {
    volatile int j = 0;
  }
  printf("%X\n", a);
}

-- 
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

Reply via email to