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

            Bug ID: 125040
           Summary: [17 regression] internal compiler error: in clean, at
                    tree-ssa-pre.cc:2166, during GIMPLE pass: pre
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lu.maltsis at postgrad dot manchester.ac.uk
  Target Milestone: ---

Created attachment 64289
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64289&action=edit
preprocessed source

```sh
$ gcc /tmp/bug.c -O2
during GIMPLE pass: pre
/tmp/bug.c: In function ‘a’:
/tmp/bug.c:3:5: internal compiler error: in clean, at tree-ssa-pre.cc:2166
    3 | int a() {
      |     ^
0x254161b internal_error(char const*, ...)
       
/home/lmaltsis/software/gcc/slot-b/src/gcc/diagnostic-global-context.cc:787
0x9c504f fancy_abort(char const*, int, char const*)
        /home/lmaltsis/software/gcc/slot-b/src/gcc/diagnostics/context.cc:1813
0x8a6307 clean
        /home/lmaltsis/software/gcc/slot-b/src/gcc/tree-ssa-pre.cc:2166
0x138859e compute_antic
        /home/lmaltsis/software/gcc/slot-b/src/gcc/tree-ssa-pre.cc:2680
0x138859e execute
        /home/lmaltsis/software/gcc/slot-b/src/gcc/tree-ssa-pre.cc:4643
/home/lmaltsis/software/gcc/slot-b/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu /tmp/bug.c -quiet -dumpdir a- -dumpbase
bug.c -dumpbase-ext .c -mtune=generic -march=x86-64 -O2 -o /tmp/ccT9t8pP.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ cat /tmp/bug.c
#include <stdio.h>
#include <stdlib.h>
int a() {
  int b;
  int *c = calloc(sizeof(int), b);
  int count;
  for (int d; d;)
    for (int e;; b++) {
      c[e] = c[b - count - 1];
      c[b - count - 1] = count;
      count = count + 1;
    }
  printf("", c);
}
```

Compiler Explorer Reproducer: https://godbolt.org/z/9ahxTf883

GCC Commit Hash: 1197598
(https://github.com/gcc-mirror/gcc/commit/1197598df31262aae4cf84e51fe876f7f0454917)

Compiles on 15.2: https://godbolt.org/z/6Me3o38Y6

Preprocessed source attached due to large size.

Reply via email to