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

            Bug ID: 117979
           Summary: ICE on x86_64-linux-gnu: in verify_loop_structure, at
                    cfgloop.cc:1742 at -Os and above
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

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

*******************************************************************************
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-bootstrap --enable-checking=yes
--prefix=/home/software/gcc-trunk --enable-sanitizers --enable-languages=c,c++
--disable-werror --enable-multilib --enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20241107 (experimental) (GCC)

*******************************************************************************
Program:
$ cat mutant.c
int a, b;
void c();
int __attribute__((returns_twice)) d(int);
int __attribute__((const)) e() {
  int f;
  if (f) {
  g:
    f = 0;
    for (; f < 6; ++f)
      if (d(b))
        goto g;
    for (;; a--)
      ;
  }
  c();
  return 0;
}

*******************************************************************************
Command Lines:
$ gcc -Os mutant.c
mutant.c: In function 'e':
mutant.c:4:28: error: basic block 13 should be marked irreducible
    4 | int __attribute__((const)) e() {
      |                            ^
mutant.c:4:28: error: edge from 13 to 3 should be marked irreducible
during GIMPLE pass: cddce
mutant.c:4:28: internal compiler error: in verify_loop_structure, at
cfgloop.cc:1742
0x560e124 internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:518
0x55aefa8 fancy_abort(char const*, int, char const*)
        ../../gcc/gcc/diagnostic.cc:1696
0x1297b50 verify_loop_structure()
        ../../gcc/gcc/cfgloop.cc:1742
0x1d0e145 execute_function_todo
        ../../gcc/gcc/passes.cc:2118
0x1d0be9c do_per_function
        ../../gcc/gcc/passes.cc:1701
0x1d0e433 execute_todo
        ../../gcc/gcc/passes.cc:2156
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.

Reply via email to