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

            Bug ID: 129081
           Summary: [17 Regression] ICE in verify_loop_structure, at
                    cfgloop.cc:1739 at -O1 after bitintlower ("size of
                    loop 1 should be 13, not 14")
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Hi,

$cat repro.c

_BitInt(200) f(unsigned b, _BitInt(200) c) {
  for (;;) {
    unsigned _BitInt(200) d = b ? c : 0;
    c = d ? __builtin_clzg(d) : 1;
  }
}

$ gcc -O1 -c repro.c
repro.c: In function 'f':
repro.c:1:14: error: size of loop 1 should be 13, not 14
    1 | _BitInt(200) f(unsigned b, _BitInt(200) c) {
      |              ^
during GIMPLE pass: bitintlower
repro.c:1:14: internal compiler error: in verify_loop_structure, at
cfgloop.cc:1739
0x2c4a51f internal_error(char const*, ...)
0xbb33bf fancy_abort(char const*, int, char const*)
0x8e9049 verify_loop_structure()
        ../../gcc/cfgloop.cc:1739
0x129c498 execute_function_todo
        ../../gcc/passes.cc:2121
0x129c977 execute_todo
        ../../gcc/passes.cc:2157
```

Only -O1 fails; -O2, -O3, -Os and `-O1 -fno-thread-jumps` compile it. 

Reproduced in Godbolt (gcc trunk, -O1 -c): https://godbolt.org/z/W6Y6MKhjf

## Checked versions
- gcc trunk 4eca40b54dd (2026-11-25, --enable-checking=yes): ICE at -O1
- gcc 16.2, 16.0.1, and 15.2.0: compile it at -O1/-O2/-O3/-Os

Thanks.

Reply via email to