Issue 87630
Summary wrong code at -O3 on x86_64-linux-gnu
Labels new issue
Assignees
Reporter zhendongsu
    This looks like a very recent regression as it does not affect 18.1.0 and earlier. 

Compiler Explorer: https://godbolt.org/z/zEGT8b351

```
[621] % clangtk -v
clang version 19.0.0git (https://github.com/llvm/llvm-project.git 4f19f15a601a5761b12c9c66d99d97dbc89ef90d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/suz-local/software/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64
[622] % 
[622] % clangtk -O2 small.c; ./a.out
[623] % clangtk -O3 small.c
[624] % ./a.out
Aborted
[625] % cat small.c
int a, b;
short c;
char d, e;
int main() {
  int h, i = 32768;
  for (a = 0; a < 32; a++) {
    b = i ^= 1;
    i |= e;
    h = i + c;
    d |= h;
  }
  if (b != 32768)
 __builtin_abort();
  return 0;
}
```


_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to