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

            Bug ID: 111130
           Summary: ice & tree check fail in useless_type_conversion_p, at
                    gimple-expr.cc:85
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

This C code:

g_61, func_100_p_104;
short g_135_3_2_2;
func_100(unsigned char p_101) {
  int __trans_tmp_1;
  for (; g_61; g_61 -= 1)
    if (func_100_p_104) {
      unsigned short left = __trans_tmp_1 = left >> p_101;
      g_135_3_2_2 |= __trans_tmp_1;
    }
}

with recent trunk gcc and compiler flag -O3, does this:

$ ~/gcc/results/bin/gcc -c -w -O3 bug949.c
during GIMPLE pass: vect
bug949.c: In function ‘func_100’:
bug949.c:3:1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85
    3 | func_100(unsigned char p_101) {
      | ^~~~~~~~
0x117c1c9 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../trunk.year/gcc/tree.cc:8948
0xa7b615 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../trunk.year/gcc/tree.h:3700
0xa7b615 useless_type_conversion_p(tree_node*, tree_node*)
        ../../trunk.year/gcc/gimple-expr.cc:85


The bug first seems to occur sometime between g:4a0633d4d499cf97
and g:abf953042ace4717, some 27 commits.

Reply via email to