https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125868
Bug ID: 125868
Summary: ICE on valid code at -O{s,2,3} on x86_64-linux-gnu: in
visit_ref_for_mod_analysis, at ipa-prop.cc:3400
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ipa
Assignee: unassigned at gcc dot gnu.org
Reporter: zhendong.su at inf dot ethz.ch
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/5e5rz8rMv
Note:
- fails: trunk
- works: 16.1 and earlier
- might be related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125857
[514] % 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/17.0.0/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 17.0.0 20260617 (experimental) (GCC)
[515] %
[515] % gcctk -O3 -c small.c
during IPA pass: cp
small.c: In function ājā:
small.c:10:1: internal compiler error: in visit_ref_for_mod_analysis, at
ipa-prop.cc:3400
10 | void j() { c = g(a); }
| ^~~~
0x26684ab internal_error(char const*, ...)
../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0xa2f74e fancy_abort(char const*, int, char const*)
../../gcc-trunk/gcc/diagnostics/context.cc:1813
0xf4f530 visit_ref_for_mod_analysis
../../gcc-trunk/gcc/ipa-prop.cc:3400
0xf4f530 visit_ref_for_mod_analysis
../../gcc-trunk/gcc/ipa-prop.cc:3391
0xe6ba0f walk_stmt_load_store_addr_ops(gimple*, void*, bool (*)(gimple*,
tree_node*, tree_node*, void*), bool (*)(gimple*, tree_node*, tree_node*,
void*), bool (*)(gimple*, tree_node*, tree_node*, void*))
../../gcc-trunk/gcc/gimple-walk.cc:805
0xf5f692 ipa_analyze_params_uses_in_bb
../../gcc-trunk/gcc/ipa-prop.cc:3424
0xf5f692 analysis_dom_walker::before_dom_children(basic_block_def*)
../../gcc-trunk/gcc/ipa-prop.cc:3568
0x23d0e87 dom_walker::walk(basic_block_def*)
../../gcc-trunk/gcc/domwalk.cc:311
0xf5cd2e ipa_analyze_node(cgraph_node*)
../../gcc-trunk/gcc/ipa-prop.cc:3638
0x24adc17 ipcp_generate_summary
../../gcc-trunk/gcc/ipa-cp.cc:6806
0x10bd5ba execute_ipa_summary_passes(ipa_opt_pass_d*)
../../gcc-trunk/gcc/passes.cc:2287
0xc63e2e ipa_passes
../../gcc-trunk/gcc/cgraphunit.cc:2269
0xc63e2e symbol_table::compile()
../../gcc-trunk/gcc/cgraphunit.cc:2367
0xc661c6 symbol_table::compile()
../../gcc-trunk/gcc/cgraphunit.cc:2345
0xc661c6 symbol_table::finalize_compilation_unit()
../../gcc-trunk/gcc/cgraphunit.cc:2626
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/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/17.0.0/
small.c -quiet -dumpbase small.c -dumpbase-ext .c -mtune=generic -march=x86-64
-O3 -o /tmp/ccBUfNEq.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.
[516] %
[516] % cat small.c
extern void f(int *);
int a, b, *c;
int *g(int i) {
int *h = &i;
while (a)
f(&b);
f(c);
return h;
}
void j() { c = g(a); }