https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122654
Bug ID: 122654
Summary: [16 Regression] ICE at -O2/O3 during GIMPLE pass: sccp
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: xxs_chy at outlook dot com
Target Milestone: ---
Reproducer: https://godbolt.org/z/1P3TaefY6
gcc version 16.0.0 20251111 (experimental) (crosstool-NG 1.28.0_rc1)
Testcase:
typedef int int32_t;
int32_t g_3, g_113, g_20;
short g_1578[][1] = {};
void main() {
int *l_19 = &g_20;
g_113 = 2;
for (; g_113; g_113 -= 1)
for (; g_3; g_3 -= 1)
*l_19 = g_1578[g_3][0] != g_1578[g_3][g_113];
}
ICE output:
during GIMPLE pass: sccp
<source>: In function 'main':
<source>:5:6: internal compiler error: Segmentation fault
5 | void main() {
| ^~~~
0x25bf0a8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x25b3e9b internal_error(char const*, ...)
???:0
0x12cde8a analyze_scalar_evolution(loop*, tree_node*)
???:0
0x13a07e3 for_each_index(tree_node**, bool (*)(tree_node*, tree_node**, void*),
void*)
???:0
0x138a67d estimate_numbers_of_iterations(loop*)
???:0
0x138b6b7 max_loop_iterations(loop*,
generic_wide_int<widest_int_storage<131072> >*)
???:0
0x15d6627 range_of_var_in_loop(vrange&, tree_node*, loop*, gimple*,
range_query*)
???:0
0xe07ed2 fold_using_range::range_of_ssa_name_with_loop_info(vrange&,
tree_node*, loop*, gphi*, fur_source&)
???:0
0xe08536 fold_using_range::range_of_phi(vrange&, gphi*, fur_source&)
???:0
0xe0c9f0 fold_using_range::fold_stmt(vrange&, gimple*, fur_source&, tree_node*)
???:0
0xdf7e33 gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*)
???:0
0xdf9a19 gimple_ranger::range_of_expr(vrange&, tree_node*, gimple*)
???:0
0x122c755 get_ref_base_and_extent(tree_node*, poly_int<1u, long>*, poly_int<1u,
long>*, poly_int<1u, long>*, bool*)
???:0
0x120e811 replace_uses_by(tree_node*, tree_node*)
???:0
0x12d4659 final_value_replacement_loop(loop*)
???:0
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.
Compiler returned: 1