[Bug tree-optimization/126871] New: ICE on valid code at -O{2,3} with -fno-vect-cost-model on x86_64-linux-gnu: verify_ssa failed

"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=126871

            Bug ID: 126871
           Summary: ICE on valid code at -O{2,3} with -fno-vect-cost-model
                    on x86_64-linux-gnu: verify_ssa failed
           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/bzva9MezM

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

[823] % 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 20260814 (experimental) [master r17-1628-gd1c12591336] (GCC) 
[824] % 
[824] % gcctk -O2 -fno-vect-cost-model small.c
small.c: In function ā€˜j’:
small.c:2:6: error: definition in block 4 does not dominate use in block 5
    2 | void j() {
      |      ^
for SSA_NAME: _14 in statement:
iftmp.4_8 = PHI <a.5_5(3), _14(5)>
PHI argument
_14
for PHI node
iftmp.4_8 = PHI <a.5_5(3), _14(5)>
during GIMPLE pass: slp
small.c:2:6: internal compiler error: verify_ssa failed
0x27d402b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0x14aef2f verify_ssa(bool, bool)
        ../../gcc-trunk/gcc/tree-ssa.cc:1226
0x10c6584 execute_function_todo
        ../../gcc-trunk/gcc/passes.cc:2107
0x10c6cde execute_todo
        ../../gcc-trunk/gcc/passes.cc:2152
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -I /usr/local/include -I /local/suz-local/software/local/include
-imultiarch x86_64-linux-gnu -iprefix
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
small.c -quiet -dumpdir a- -dumpbase small.c -dumpbase-ext .c -mtune=generic
-march=x86-64 -O2 -fvect-cost-model=unlimited -o /tmp/ccALaX9G.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.
[825] % 
[825] % cat small.c
int a, c, d, e, i;
void j() {
  int k, l, m, n, o, p;
  k = (c + d) ^ 1088271051541471734;
  l = k & 1088271051541471734;
  p = ~l;
  o = ~k;
  i = -1719165431;
  m = o & i;
  n = ~m;
  k = n & p;
  e = c - (a ? a : k) + k;
}
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.