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

            Bug ID: 51175
           Summary: wrong code at -O3 on x86_64-linux-gnu
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

It appears to be a latent issue. It affects all versions since clang-7.


$ clang-trunk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
599b2f00370ee79e812d2776f2af57fae36d02e9)


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

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

$ clang-7 -O3 abc.c ; ./a.out
0


$ cat abc.c
short a = -1;
short c = 4;
int b;
int main() {
  char d;
  b = 65527 & ++a;
  d = 0 == 0 ? b : 0;
  if (d)
    c = 0;
  printf("%d\n", c);
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to