[Bug tree-optimization/124692] New: ICE on valid code at -O3 on x86_64-linux-gnu: tree check: expected ssa_name, have integer_cst in expand_simple_operations, at tree-ssa-loop-niter.cc:2885
zhendong.su at inf dot ethz.ch
gcc-bugzilla@gcc.gnu.org
Mon Mar 30 09:07:10 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124692
Bug ID: 124692
Summary: ICE on valid code at -O3 on x86_64-linux-gnu: tree
check: expected ssa_name, have integer_cst in
expand_simple_operations, at
tree-ssa-loop-niter.cc:2885
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: ---
Note:
- fails: trunk
- works: 15.2 and earlier
- recent as it doesn't seem to fail on the Compiler Explorer build
[516] % 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.1/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.1 20260330 (experimental) (GCC)
[517] %
[517] % gcctk -O3 small.c
during GIMPLE pass: sccp
small.c: In function ‘main’:
small.c:3:5: internal compiler error: tree check: expected ssa_name, have
integer_cst in expand_simple_operations, at tree-ssa-loop-niter.cc:2885
3 | int main() {
| ^~~~
0x25dae1b internal_error(char const*, ...)
../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0x926edd tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc-trunk/gcc/tree.cc:9219
0x8f5539 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc-trunk/gcc/tree.h:3780
0x8f5539 expand_simple_operations
../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:2885
0x13a0c37 expand_simple_operations(tree_node*, tree_node*)
../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:2949
0x13a7231 number_of_iterations_exit_assumptions(loop*, edge_def*,
tree_niter_desc*, gcond**, bool, basic_block_def**)
../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:3298
0x13a95b2 number_of_iterations_exit_assumptions(loop*, edge_def*,
tree_niter_desc*, gcond**, bool, basic_block_def**)
../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:3387
0x13a95b2 number_of_iterations_exit(loop*, edge_def*, tree_niter_desc*, bool,
bool, basic_block_def**)
../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:3374
0x13a9af7 estimate_numbers_of_iterations(loop*)
../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:5022
0x13ad384 loop_exits_before_overflow
../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:5426
0x13ad384 scev_probably_wraps_p(tree_node*, tree_node*, tree_node*, gimple*,
loop*, bool)
../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:5678
0x13ad384 scev_probably_wraps_p(tree_node*, tree_node*, tree_node*, gimple*,
loop*, bool)
../../gcc-trunk/gcc/tree-ssa-loop-niter.cc:5636
0x15fa89f get_scev_info
../../gcc-trunk/gcc/vr-values.cc:237
0x15fa89f range_of_var_in_loop(vrange&, tree_node*, loop*, gimple*,
range_query*)
../../gcc-trunk/gcc/vr-values.cc:304
0xe1c5ab fold_using_range::range_of_ssa_name_with_loop_info(vrange&,
tree_node*, loop*, gphi*, fur_source&)
../../gcc-trunk/gcc/gimple-range-fold.cc:1484
0xe1cc46 fold_using_range::range_of_phi(vrange&, gphi*, fur_source&)
../../gcc-trunk/gcc/gimple-range-fold.cc:1231
0xe21310 fold_using_range::fold_stmt(vrange&, gimple*, fur_source&, tree_node*)
../../gcc-trunk/gcc/gimple-range-fold.cc:683
0xe0b48b gimple_ranger::fold_range_internal(vrange&, gimple*, tree_node*)
../../gcc-trunk/gcc/gimple-range.cc:282
0xe0b48b gimple_ranger::prefill_stmt_dependencies(tree_node*)
../../gcc-trunk/gcc/gimple-range.cc:423
0xe0c3da gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*)
../../gcc-trunk/gcc/gimple-range.cc:339
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.0.1/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/16.0.1/
small.c -quiet -dumpdir a- -dumpbase small.c -dumpbase-ext .c -mtune=generic
-march=x86-64 -O3 -o /tmp/ccPG8Cw7.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.
[518] %
[518] % cat small.c
int a, b, d, e[3][1], f, g, h;
unsigned c;
int main() {
while (b) {
h = g;
for (b = 0; b < 2; b++)
;
for (; c; c++) {
int j = e[b][h];
f = a < 0 ? j : j - a;
if (!f)
break;
g = c;
}
}
return 0;
}
More information about the Gcc-bugs
mailing list