https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103204
Bug ID: 103204 Summary: [11/12 Regression] ICE: in vn_reference_insert_pieces, at tree-ssa-sccvn.c:3842 (on -O2 and above) Product: gcc Version: 12.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 all. $cat small.c #include <stdint.h> int a[][1]; int b, c; void d() { int32_t e; int32_t f[0]; int32_t *g; for (; e;) c = b; if (a[0][b] = f != 3) g = &f[b]; int32_t h; *g = *g = *g = h; } $gcc -w -O2 small.c during GIMPLE pass: fre small.c: In function ādā: small.c:14:1: internal compiler error: in vn_reference_insert_pieces, at tree-ssa-sccvn.c:3842 14 | } | ^ 0x6abce4 vn_reference_insert_pieces(tree_node*, int, int, tree_node*, vec<vn_reference_op_struct, va_heap, vl_ptr>, tree_node*, unsigned int) ../../gcc/tree-ssa-sccvn.c:3842 0xdbad48 vn_reference_lookup_or_insert_for_pieces ../../gcc/tree-ssa-sccvn.c:2339 0xdbad48 vn_walk_cb_data::finish(int, int, tree_node*) ../../gcc/tree-ssa-sccvn.c:1900 0xdc12ae vn_reference_lookup_3 ../../gcc/tree-ssa-sccvn.c:3160 0xd04652 walk_non_aliased_vuses(ao_ref*, tree_node*, bool, void* (*)(ao_ref*, tree_node*, void*), void* (*)(ao_ref*, tree_node*, void*, translate_flags*), tree_node* (*)(tree_node*), unsigned int&, void*) ../../gcc/tree-ssa-alias.c:3725 0xdbc140 vn_reference_lookup(tree_node*, tree_node*, vn_lookup_kind, vn_reference_s**, bool, tree_node**, tree_node*) ../../gcc/tree-ssa-sccvn.c:3700 0xdbc911 eliminate_dom_walker::eliminate_stmt(basic_block_def*, gimple_stmt_iterator*) ../../gcc/tree-ssa-sccvn.c:6384 0xdbe1dd eliminate_dom_walker::before_dom_children(basic_block_def*) ../../gcc/tree-ssa-sccvn.c:6722 0xdbe1dd eliminate_dom_walker::before_dom_children(basic_block_def*) ../../gcc/tree-ssa-sccvn.c:6655 0x17a286e dom_walker::walk(basic_block_def*) ../../gcc/domwalk.c:309 0xdb57aa eliminate_with_rpo_vn(bitmap_head*) ../../gcc/tree-ssa-sccvn.c:6902 0xdc47c3 do_rpo_vn ../../gcc/tree-ssa-sccvn.c:8014 0xdc5670 execute ../../gcc/tree-ssa-sccvn.c:8096 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/gcc/build/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/home/haoxin/haoxin-data/dut-research/compilers/gcc/build/ --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --enable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20211112 (experimental) (GCC) Note that GCC-11.2 above versions behave the same. Can check here: https://godbolt.org/z/WP8naWWMz Thanks, Haoxin