https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126150
Bug ID: 126150
Summary: [16/17 Regression] ICE Segmentation fault / in
delink_imm_use, at ssa-iterators.h:285 since r16-5056
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: mjires at gcc dot gnu.org
CC: rguenther at suse dot de
Target Milestone: ---
Compiling reduced testcase libgomp/testsuite/libgomp.c++/reduction-6.C results
in ICE since r16-5056-g9ded9b80c11155.
$ cat reduction-6.C
struct B {
B() { t = 0; }
~B();
int t;
} w3[1][2];
$ g++ reduction-6.C -fnon-call-exceptions -Ofast
--param=max-completely-peel-loop-nest-depth=0
during GIMPLE pass: threadfull
reduction-6.C: In function ‘(static initializers for reduction-6.C)’:
reduction-6.C:5:11: internal compiler error: in delink_imm_use, at
ssa-iterators.h:285
5 | } w3[1][2];
| ^
0x2aeb1f5 internal_error(char const*, ...)
/home/mjires/git/GCC/master/gcc/diagnostic-global-context.cc:787
0x2af66e3 fancy_abort(char const*, int, char const*)
/home/mjires/git/GCC/master/gcc/diagnostics/context.cc:1813
0xf9a76f delink_imm_use(ssa_use_operand_t*)
/home/mjires/git/GCC/master/gcc/ssa-iterators.h:285
0xf9a76f delink_stmt_imm_use(gimple*)
/home/mjires/git/GCC/master/gcc/ssa-iterators.h:1053
0xf99af0 gsi_remove(gimple_stmt_iterator*, bool)
/home/mjires/git/GCC/master/gcc/gimple-iterator.cc:585
0x143fb52 remove_bb
/home/mjires/git/GCC/master/gcc/tree-cfg.cc:2274
0xdae247 delete_basic_block(basic_block_def*)
/home/mjires/git/GCC/master/gcc/cfghooks.cc:662
0x1451509 remove_edge_and_dominated_blocks(edge_def*)
/home/mjires/git/GCC/master/gcc/tree-cfg.cc:9059
0x1451bda gimple_purge_dead_eh_edges(basic_block_def*)
/home/mjires/git/GCC/master/gcc/tree-cfg.cc:9103
0x1451f9d replace_uses_by(tree_node*, tree_node*)
/home/mjires/git/GCC/master/gcc/tree-cfg.cc:1953
0x14526d5 gimple_merge_blocks
/home/mjires/git/GCC/master/gcc/tree-cfg.cc:2029
0xdae869 merge_blocks(basic_block_def*, basic_block_def*)
/home/mjires/git/GCC/master/gcc/cfghooks.cc:876
0x146211d cleanup_tree_cfg_bb
/home/mjires/git/GCC/master/gcc/tree-cfgcleanup.cc:906
0x1462904 cleanup_tree_cfg_noloop
/home/mjires/git/GCC/master/gcc/tree-cfgcleanup.cc:1239
0x1462904 cleanup_tree_cfg(unsigned int)
/home/mjires/git/GCC/master/gcc/tree-cfgcleanup.cc:1322
0x12ad66a execute_function_todo
/home/mjires/git/GCC/master/gcc/passes.cc:2069
0x12adca4 do_per_function
/home/mjires/git/GCC/master/gcc/passes.cc:1699
0x12ade00 execute_todo
/home/mjires/git/GCC/master/gcc/passes.cc:2152
/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1plus -quiet
-D_GNU_SOURCE reduction-6.C -quiet -dumpdir a- -dumpbase reduction-6.C
-dumpbase-ext .C -mtune=generic -march=x86-64 -Ofast -fnon-call-exceptions
--param=max-completely-peel-loop-nest-depth=0 -o /tmp/cclLhNpE.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.
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260707 (experimental) (GCC)