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

            Bug ID: 123043
           Summary: [16 Regression] ICE on zlib -O3: GIMPLE pass: vect:
                    verify_ssa failed: definition in block 133 does not
                    dominate use in block 130
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

zlib gets a wrong code on i686-linux for me when built on gcc-master since
r16-5780-g65a3849eb46df2 . I was not able to extract the full example from zlib
(too much code).

When building `zlib` with `--enable-checking=all` gcc ICEs and points at the
same function it stopped at.

Minimal ICE reproducer:

// $ cat inffast.c.c
char sad_memcpy_pout;
int inflate_fast_len;
void inflate_fast() {
  char *out = &sad_memcpy_pout, *from;
  do {
    *out++ = *from++;
    *out++ = *from++;
    inflate_fast_len -= 3;
  } while (inflate_fast_len > 2);
}

Crashing:

gcc/xgcc -Bgcc -c inffast.c.c -o bug.o -O3
inffast.c.c: In function ‘inflate_fast’:
inffast.c.c:3:6: error: definition in block 17 does not dominate use in block
14
    3 | void inflate_fast() {
      |      ^~~~~~~~~~~~
for SSA_NAME: tmp.16_68 in statement:
_19 = PHI <tmp.16_68(14), _38(6), _57(15)>
PHI argument
tmp.16_68
for PHI node
_19 = PHI <tmp.16_68(14), _38(6), _57(15)>
during GIMPLE pass: vect
inffast.c.c:3:6: internal compiler error: verify_ssa failed
0xa3322e4 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*, char**,
diagnostics::kind)
        ???:0
0xa32531f internal_error(char const*, ...)
        ???:0
0x8f90305 verify_ssa(bool, bool)
        ???:0
0x8b26147 execute_function_todo(function*, void*)
        ???:0
0x8b26206 do_per_function(void (*)(function*, void*), void*)
        ???:0
0x8b2635b execute_todo(unsigned int)
        ???:0
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.

$ gcc/xgcc -Bgcc -v
Reading specs from gcc/specs
COLLECT_GCC=gcc/xgcc
COLLECT_LTO_WRAPPER=gcc/lto-wrapper
Target: i686-unknown-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap --disable-lto --disable-libsanitizer --enable-languages=c
CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0' LDFLAGS='-O1 -g0'
--build=i686-unknown-linux-gnu --host=i686-unknown-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.0 20251207 (experimental) (GCC)

Reply via email to