[Bug tree-optimization/126965] New: ICE on valid code at -O{2,3} with -fno-tree-dominator-opts on x86_64-linux-gnu: Segmentation fault

"zhendong.su at inf dot ethz.ch via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126965

            Bug ID: 126965
           Summary: ICE on valid code at -O{2,3} with
                    -fno-tree-dominator-opts on x86_64-linux-gnu:
                    Segmentation fault
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

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

Note:
- fails: trunk
- works: 16.2 and earlier

[572] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.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++,lto --disable-werror
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260819 (experimental) (GCC) 
[573] % 
[573] % gcctk -O2 -fno-tree-dominator-opts small.c
gcctk: internal compiler error: cc1 terminated by signal 11 (Segmentation
fault)
Segmentation fault
[574] % 
[574] % cat small.c
int a[1], b;
short c;
unsigned short d;
int main() {
  for (int f = 0; f < 1; f++)
    if (c) {
      for (c = 0; c < 2; c++)
        for (b = 1; b; b = a[c + 1])
          ;
      d = c;
    }
  return 0;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.