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

            Bug ID: 114259
           Summary: [14 Regression] ICE during GIMPLE pass: slp: internal
                    compiler error: 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: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Created attachment 57637
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57637&action=edit
-freport-bug output

Testcase:
Testcase:
long h;
int i;
char j;
short volatile k;

void l() {
  i = h = 0;
  for (; h < 7; h = h += 1)
    i ^= (0 != k) + (long)j;
}

Backtrace:
> /scratch/tc-testing/tc-mar-5/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc 
> -march=rv64gcv -O3 red.c -o red.out
during GIMPLE pass: slp
./red.c: In function 'l':
./red.c:6:6: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85
    6 | void l() {
      |      ^
0xb0f001 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../../gcc/gcc/tree.cc:9005
0xa38bd5 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../../gcc/gcc/tree.h:3767
0xa38bd5 useless_type_conversion_p(tree_node*, tree_node*)
        ../../../gcc/gcc/gimple-expr.cc:85
0x1365242 verify_gimple_assign_binary
        ../../../gcc/gcc/tree-cfg.cc:4305
0x13704ee verify_gimple_in_cfg(function*, bool, bool)
        ../../../gcc/gcc/tree-cfg.cc:5599
0x11f1b10 execute_function_todo
        ../../../gcc/gcc/passes.cc:2088
0x11f205b execute_todo
        ../../../gcc/gcc/passes.cc:2142
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.

Godbolt: https://godbolt.org/z/s1M1WcGvc

Looks like a recent regression (within 2 days) since the fuzzer found ~10
instances of this failure last night.

Found via fuzzer.

Reply via email to