[Bug tree-optimization/126936] New: ICE at -O3 on x86_64-linux-gnu during SLP pass: verify_ssa failed due to definition following use

"xintong.zhou1 at uwaterloo dot ca via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126936

            Bug ID: 126936
           Summary: ICE at -O3 on x86_64-linux-gnu during SLP pass:
                    verify_ssa failed due to definition following use
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xintong.zhou1 at uwaterloo dot ca
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/5P555oeqT

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=/data/x27zhou/compiler-nightly/install/gcc/bin/gcc
COLLECT_LTO_WRAPPER=/data/x27zhou/compiler-nightly/install/gcc/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /data/x27zhou/compiler-nightly/src/gcc/configure CC='ccache
clang' CXX='ccache clang++' --enable-checking=yes
--disable-bootstrap--disable-multilib --enable-languages=c,c++
--prefix=/data/x27zhou/compiler-nightly/install/gcc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260818 (experimental) (GCC)
$
$ gcc-trunk -O3 small.c
small.c: In function ‘fn1’:
small.c:3:6: error: definition in block 4 follows the use
    3 | void fn1() {
      |      ^~~
for SSA_NAME: _157 in statement:
_163 = BIT_FIELD_REF <_157, 32, 0>;
during GIMPLE pass: slp
small.c:3:6: internal compiler error: verify_ssa failed
0x25e658f internal_error(char const*, ...)
       
/data/x27zhou/compiler-nightly/src/gcc/gcc/diagnostic-global-context.cc:787
0x1337f20 verify_ssa(bool, bool)
        /data/x27zhou/compiler-nightly/src/gcc/gcc/tree-ssa.cc:1226
0xf0f404 execute_function_todo(function*, void*)
        /data/x27zhou/compiler-nightly/src/gcc/gcc/passes.cc:2107
0xf0dcf1 execute_todo(unsigned int)
        /data/x27zhou/compiler-nightly/src/gcc/gcc/passes.cc:2152
/data/x27zhou/compiler-nightly/install/gcc/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu small.c -quiet -dumpdir a- -dumpbase
small.c -dumpbase-ext .c -mtune=generic -march=x86-64 -O3 -o /tmp/ccQdY2jM.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 small.c
int *c;
char d;
void fn1() {
  for (; *(c + 78 % 16);)
    ;
  for (int e = 0; e < 32; e += 2) {
    d = c[e & 15] % 3u;
    c[0] = c[0] & d;
  }
}
int main() {}
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.