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

            Bug ID: 121756
           Summary: ICE on valid code at -O3 on x86_64-linux-gnu:
                    verify_ssa failed
           Product: gcc
           Version: unknown
            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/dbbM47P74

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

[658] % 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/16.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
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.0 20250902 (experimental) (GCC)
[659] %
[659] % gcctk -O3 small.c
small.c: In function ‘main’:
small.c:26:5: error: stmt with wrong VUSE
   26 | int main() {
      |     ^~~~
# VUSE <.MEM_1(D)>
_10 = f[1];
expected .MEM_13
during GIMPLE pass: sink
small.c:26:5: internal compiler error: verify_ssa failed
0x255c04b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:786
0x1443ffa verify_ssa(bool, bool)
        ../../gcc-trunk/gcc/tree-ssa.cc:1203
0x10755f4 execute_function_todo
        ../../gcc-trunk/gcc/passes.cc:2104
0x1075a6b execute_todo
        ../../gcc-trunk/gcc/passes.cc:2149
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.
[660] % cat small.c
int a, b, *c = &b;
void g(int i) {
  int d = 0, e, f[] = {a}, j = a;
  e = b;
  if (e - i)
    return;
  a = 0;
h:
  if (e) {
    e = j;
    if (f[3])
      goto k;
    goto h;
  }
  while (1) {
    d = -1;
    while (1) {
      if (d - 1 - j < 0)
        return;
    k:
      if (f[1])
        break;
    }
  }
}
int main() {
  g(1);
  return 0;
}

Reply via email to