https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112509

            Bug ID: 112509
           Summary: GCC: 14: internal compiler error: in verify_range, at
                    value-range.cc:1132
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 141242068 at smail dot nju.edu.cn
  Target Milestone: ---

Compiler Explorer: https://gcc.godbolt.org/z/151vEnafj

When compiling this program with `gcc-14 -O2 -fno-tree-vrp -fno-tree-fre
-fno-tree-forwprop`, gcc crashes:

```
struct S {
  unsigned j : 3;
};
int k, l, m_1 = {0};
void f(int l, struct S x) {
  unsigned int k_1;
  while (m_1 % 8) switch (x.j) {
    case 1:
    case 3:
    case 4:
    case 6:
    case 2:
    case 5: l = m_1;
    case 7:
    case 0: k_1 = 0;
    default: break;
    }
}
void foo(struct S x) { f(l, x); }
```

The crash output:
```
during GIMPLE pass: dom
<source>: In function 'f':
<source>:5:6: internal compiler error: in verify_range, at value-range.cc:1132
    5 | void f(int l, struct S x) {
      |      ^
0x238b06e internal_error(char const*, ...)
        ???:0
0xa1125c fancy_abort(char const*, int, char const*)
        ???:0
0x148ea37 irange::set(tree_node*, generic_wide_int<wide_int_storage> const&,
generic_wide_int<wide_int_storage> const&, value_range_kind)
        ???:0
0x144ca1f find_case_label_range(gswitch*, irange const*)
        ???:0
0x139e1ef hybrid_jt_simplifier::simplify(gimple*, gimple*, basic_block_def*,
jt_state*)
        ???:0
0x139d525 jump_threader::simplify_control_stmt_condition(edge_def*, gimple*)
        ???:0
0x139db5a jump_threader::thread_through_normal_block(vec<jump_thread_edge*,
va_heap, vl_ptr>*, edge_def*, bitmap_head*)
        ???:0
0x139fa66 jump_threader::thread_across_edge(edge_def*)
        ???:0
0x139fc5a jump_threader::thread_outgoing_edges(basic_block_def*)
        ???:0
0x126f828 dom_opt_dom_walker::after_dom_children(basic_block_def*)
        ???:0
0x1ed3f2f dom_walker::walk(basic_block_def*)
        ???: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
```

Reply via email to