https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122890
Bug ID: 122890
Summary: ICE in `tree_check` (from `expand_gimple_cond`)
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: matmal01 at gcc dot gnu.org
Target Milestone: ---
Since r16-5585-g1c9d3216113676 the following testcase has been ICE'ing.
```
#include <vector>
int foo()
{
bool xs[] = { true, true, false, true };
bool s[] = { true, true, false };
std::vector<bool> x(xs, xs+4);
std::vector<bool> g(s, s+3);
g.push_back(true);
if (g != x)
__builtin_abort();
return 0;
}
```
```
vshcmd: > ./gcc-install/bin/g++ \
vshcmd: > -Wall -Wextra \
vshcmd: > -c --std=c++11 -Ofast repro.cc -o repro.o
> > during RTL pass: expand
repro.cc: In function ‘int foo()’:
repro.cc:3:5: internal compiler error: tree check: expected ssa_name, have
vector_cst in get_gimple_for_ssa_name, at tree-outof-ssa.h:71
3 | int foo()
| ^~~
0x27364c7 internal_error(char const*, ...)
../../gcc-source/gcc/diagnostic-global-context.cc:787
0x881a5f tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc-source/gcc/tree.cc:9188
0x1293ab3 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc-source/gcc/tree.h:3746
0x1293ab3 get_gimple_for_ssa_name(tree_node*)
../../gcc-source/gcc/tree-outof-ssa.h:71
0x1293ab3 get_gimple_for_ssa_name(tree_node*)
../../gcc-source/gcc/tree-outof-ssa.h:69
0x12880c3 emit_cmp_and_jump_insns(rtx_def*, rtx_def*, rtx_code, rtx_def*,
machine_mode, int, tree_node*, rtx_def*, profile_probability)
../../gcc-source/gcc/optabs.cc:4861
0xe4d65b do_compare_rtx_and_jump(rtx_def*, rtx_def*, rtx_code, int, tree_node*,
machine_mode, rtx_def*, rtx_code_label*, rtx_code_label*, profile_probability)
../../gcc-source/gcc/dojump.cc:1256
0xe4ee8b do_jump
../../gcc-source/gcc/dojump.cc:620
0xe506b3 do_jump_1
../../gcc-source/gcc/dojump.cc:213
0xdcce23 expand_gimple_cond
../../gcc-source/gcc/cfgexpand.cc:3005
0xdcce23 expand_gimple_basic_block
../../gcc-source/gcc/cfgexpand.cc:6352
0xdce447 execute
../../gcc-source/gcc/cfgexpand.cc:7248
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.
lego-c2-qs-78:mmalcomson [05:29:14] $
```