https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117522

            Bug ID: 117522
           Summary: Miscompile with -O3 and -O0/1/2
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yunboni at smail dot nju.edu.cn
  Target Milestone: ---

When I compiled this code with -O3, it triggered SIGSEGV. With -O0/1/2, it
outputs 0:

```c
int printf(const char *, ...);
int a, b = 4095;
int c[6];
const short d = -2;
void e(char f) { b = c[(b ^ f) & 255]; }
int main() {
  e(d >> 8);
  printf("%X\n", a);
}
```

Details can be found here: https://godbolt.org/z/fr8s9j6a9
  • [Bug c/117522] New: Miscompil... yunboni at smail dot nju.edu.cn via Gcc-bugs

Reply via email to