Link to the Compiler Explorer: https://godbolt.org/z/fsGf47Wfv Reproducer: bool a; char b; void fn1(int d, short x[], bool y[]) { for (short i = 0; i < d; i = 0) { if ((x[i] + x[i]) ^ !y[i]) a = 0; b = y[i]; } } Error: >$ g++ -c -O2 func.cpp during GIMPLE pass: dom func.cpp: In function 'void fn1(int, short int*, bool*)': func.cpp:3:6: internal compiler error: in verify_range, at value-range.cc:1147 3 | void fn1(int d, short x[], bool y[]) { | ^~~ 0x90038d irange::verify_range() /testing/gcc/gcc_src_master/gcc/value-range.cc:1147 0x1588a87 irange::operator=(irange const&) /testing/gcc/gcc_src_master/gcc/value-range.cc:818 0x158bd67 irange::invert() /testing/gcc/gcc_src_master/gcc/value-range.cc:2799 0x2178487 operator_logical_not::fold_range(irange&, tree_node*, irange const&, irange const&, relation_kind_t) const /testing/gcc/gcc_src_master/gcc/range-op.cc:3614 0x2074635 gori_compute::compute_operand1_range(vrange&, gimple_range_op_handler&, vrange const&, tree_node*, fur_source&, value_relation*) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:1086 0x2073c8d gori_compute::compute_operand_range(vrange&, gimple*, vrange const&, tree_node*, fur_source&, value_relation*) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:692 0x20746af gori_compute::compute_operand1_range(vrange&, gimple_range_op_handler&, vrange const&, tree_node*, fur_source&, value_relation*) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:1140 0x2073c8d gori_compute::compute_operand_range(vrange&, gimple*, vrange const&, tree_node*, fur_source&, value_relation*) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:692 0x2074fc0 gori_compute::compute_operand2_range(vrange&, gimple_range_op_handler&, vrange const&, tree_node*, fur_source&, value_relation*) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:1228 0x20734e5 gori_compute::compute_operand_range(vrange&, gimple*, vrange const&, tree_node*, fur_source&, value_relation*) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:694 0x2077158 gori_compute::outgoing_edge_range_p(vrange&, edge_def*, tree_node*, range_query&) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:1358 0x20679ec ranger_cache::edge_range(vrange&, edge_def*, tree_node*, ranger_cache::rfd_mode) /testing/gcc/gcc_src_master/gcc/gimple-range-cache.cc:964 0x2063d4b gimple_ranger::range_on_edge(vrange&, edge_def*, tree_node*) /testing/gcc/gcc_src_master/gcc/gimple-range.cc:242 0x206d86b fold_using_range::range_of_phi(vrange&, gphi*, fur_source&) /testing/gcc/gcc_src_master/gcc/gimple-range-fold.cc:750 0x20706b8 fold_using_range::fold_stmt(vrange&, gimple*, fur_source&, tree_node*) /testing/gcc/gcc_src_master/gcc/gimple-range-fold.cc:491 0x2062de4 gimple_ranger::fold_range_internal(vrange&, gimple*, tree_node*) /testing/gcc/gcc_src_master/gcc/gimple-range.cc:258 0x2062de4 gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*) /testing/gcc/gcc_src_master/gcc/gimple-range.cc:319 0x20639c0 gimple_ranger::range_of_expr(vrange&, tree_node*, gimple*) /testing/gcc/gcc_src_master/gcc/gimple-range.cc:126 0x1398aaf cprop_operand /testing/gcc/gcc_src_master/gcc/tree-ssa-dom.cc:1968 0x139aa61 cprop_into_stmt /testing/gcc/gcc_src_master/gcc/tree-ssa-dom.cc:2045 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 gcc version 13.0.0 20221011 (0ecd0f1cc6f8f3ba818946a42b22c2ab61f46825)
Dup. *** This bug has been marked as a duplicate of bug 107195 ***