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

            Bug ID: 108148
           Summary: ICE on valid code with "-O3
                    -fno-inline-functions-called-once
                    -fno-inline-small-functions -fno-tree-ccp
                    -fno-tree-dce -fno-tree-vrp" on x86_64-linux-gnu:
                    maximum number of generated reload insns per insn
                    achieved (90)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It appears to be a recent regression.

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


[592] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
--with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20221216 (experimental) [master r13-4745-g92eb0adc14a] (GCC) 
[593] % 
[593] % gcctk -O3 -fno-inline-functions-called-once -fno-inline-small-functions
-fno-tree-ccp -fno-tree-dce -fno-tree-vrp small.c
during RTL pass: reload
small.c: In function ‘p.constprop’:
small.c:31:1: internal compiler error: maximum number of generated reload insns
per insn achieved (90)
   31 | }
      | ^
0xd1bf66 lra_constraints(bool)
        ../../gcc-trunk/gcc/lra-constraints.cc:5137
0xd0794a lra(_IO_FILE*)
        ../../gcc-trunk/gcc/lra.cc:2375
0xcbfa99 do_reload
        ../../gcc-trunk/gcc/ira.cc:5949
0xcbfa99 execute
        ../../gcc-trunk/gcc/ira.cc:6135
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.
[594] % 
[594] % cat small.c
struct a {
  unsigned b;
  int c;
  int d;
  unsigned : 5;
} l, n;
struct e {
  unsigned b;
  int f;
  int a;
} j;
int g, i, k, m;
unsigned h;
const struct a o;
static struct a p(const struct a q) {
  if (m) {
    goto L;
  L:
    for (; g; g++) {
      struct e a[8] = {j};
      for (; h < 2; h++)
        l = q;
      if (i) {
        k = 0;
        for (; k < 2; k++)
          ;
      }
    }
  }
  return q;
}
int main() {
  n = p(o);
  return 0;
}
  • [Bug rtl-optimization/108148] ... zhendong.su at inf dot ethz.ch via Gcc-bugs

Reply via email to