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

            Bug ID: 112495
           Summary: GCC: 14: internal compiler error: verify_gimple failed
           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/7sM17Pfbb

When compile this program with `gcc-14 -O1`, gcc ICEs:
```
typedef struct { int v; } T1;
typedef struct { T1 v[32]; } T2;

T1 s;
T1 f1() { return s; }

void f2(__seg_gs T2 *p, int n) {
  for (int i = 0; i < n; ++i) p->v[i] = f1();
}
```

Interestingly, if replacing the call of `f1`() by `s` (manual inline f1), this
crash disappears.

The crash output:
```
<source>: In function 'f2':
<source>:7:6: error: mismatching comparison operand types
    7 | void f2(__seg_gs T2 *p, int n) {
      |      ^~
<address-space-2> struct T2 *
struct T1 *
_22 = p_6(D) >= _21;
<source>:7:6: error: mismatching comparison operand types
<address-space-2> struct T2 *
struct T1 *
_27 = _26 <= &s;
during GIMPLE pass: vect
<source>:7:6: internal compiler error: verify_gimple failed
0x238b15e internal_error(char const*, ...)
        ???:0
0x117b6c9 verify_gimple_in_cfg(function*, bool, bool)
        ???: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