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

            Bug ID: 111128
           Summary: ICE: tree check: expected class 'type', have
                    'exceptional' (error_mark) in
                    useless_type_conversion_p, at gimple-expr.cc:85
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shaohua.li at inf dot ethz.ch
  Target Milestone: ---

gcc at -O2/3 crashes on the following test case.

Bisected to r14-2987-g1a599caab8

Compiler explorer: https://godbolt.org/z/dxT134o4d

$ cat a.c
int a, b, c, e, g;
short *d;
unsigned char f;
int h() {
  f &= g;
  for (; b; b++) {
    a = 2;
    for (; a; a--)
      c = 0;
    if (c)
      continue;
    e = (unsigned short)*d >> f;
  }
}
int main() {}
$
$ gcc -O2 a.c 
during GIMPLE pass: vect
a.c: In function ‘h’:
a.c:4:5: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85
    4 | int h() {
      |     ^
0x2185dae internal_error(char const*, ...)
        ???:0
0x89cd86 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ???:0
0x1109f71 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
$

Reply via email to