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

            Bug ID: 111882
           Summary: GCC: 14: internal compiler error: in
                    get_expr_operands, at tree-ssa-operands.cc:940
           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/h9MMnxbvK

When compile this program with option -O2, gcc crashes:
```
static void __attribute__((noipa)) f(int n) {
  int i, j;
  struct S { char d[n]; int a; int b : 17; int c : 12; };
  struct S A[100][1111];
  for (i = 0; i < 100; i++) {
    asm volatile("" : : "g"(&A[0][0]) : "memory");
    for (j = 0; j < 1111; j++) A[i][j].b = 2;
  }
}

void g(void) { f(1); }
```

The stack dump:
```
unhandled expression in get_expr_operands():
 <save_expr 0x7fe6f6035440
    type <integer_type 0x7fe6f5ea55e8 int sizes-gimplified asm_written public
SI
        size <integer_cst 0x7fe6f5ea7180 constant 32>
        unit-size <integer_cst 0x7fe6f5ea7198 constant 4>
        align:32 warn_if_not_align:0 symtab:-167332928 alias-set 3
canonical-type 0x7fe6f5ea55e8 precision:32 min <integer_cst 0x7fe6f5ea7138
-2147483648> max <integer_cst 0x7fe6f5ea7150 2147483647>
        pointer_to_this <pointer_type 0x7fe6f5eadb28>>
    side-effects public
    arg:0 <var_decl 0x7fe6f5e94f30 n.0 type <integer_type 0x7fe6f5ea55e8 int>
        used ignored SI <source>:3:10 size <integer_cst 0x7fe6f5ea7180 32>
unit-size <integer_cst 0x7fe6f5ea7198 4>
        align:32 warn_if_not_align:0 context <function_decl 0x7fe6f6033b00 f>>>

during GIMPLE pass: ifcvt
<source>: In function 'f':
<source>:1:36: internal compiler error: in get_expr_operands, at
tree-ssa-operands.cc:940
    1 | static void __attribute__((noipa)) f(int n) {
      |                                    ^
0x231788e internal_error(char const*, ...)
        ???:0
0xa0002a fancy_abort(char const*, int, char const*)
        ???:0
0x12e792d operands_scanner::get_expr_operands(tree_node**, int)
        ???:0
0x12e71b8 operands_scanner::get_expr_operands(tree_node**, int)
        ???:0
0x12e71b8 operands_scanner::get_expr_operands(tree_node**, int)
        ???:0
0x12e71b8 operands_scanner::get_expr_operands(tree_node**, int)
        ???:0
0x12e7e50 operands_scanner::parse_ssa_operands()
        ???:0
0x12e8cfa operands_scanner::build_ssa_operands()
        ???:0
0x12e8f44 update_stmt_operands(function*, gimple*)
        ???:0
0xd66fec gsi_insert_before(gimple_stmt_iterator*, gimple*, gsi_iterator_update)
        ???:0
0x1196551 tree_if_conversion(loop*, vec<gimple*, va_heap, vl_ptr>*)
        ???: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.
```

Reply via email to