[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    [Bug tree-optimization/115143] New: [14/15 Regression] tree check: expected class 'type', have 'exce
From:       patrick at rivosinc dot com via Gcc-bugs <gcc-bugs () gcc ! gnu ! org>
Date:       2024-05-17 21:29:16
Message-ID: bug-115143-4 () http ! gcc ! gnu ! org/bugzilla/
[Download RAW message or body]

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

            Bug ID: 115143
           Summary: [14/15 Regression] tree check: expected class 'type',
                    have 'exceptional' (error_mark) in
                    useless_type_conversion_p, at gimple-expr.cc:85
           Product: gcc
           Version: 15.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: ---

Testcase:
short a, d;
char b;
long c;
unsigned long e, f;
void g(unsigned long h) {
  if (c ? e : b)
    if (e)
      if (d) {
        a = f ? ({
          unsigned long i = d ? f : 0, j = e ? h : 0;
          i < j ? i : j;
        }) : 0;
      }
}

Backtrace:
> /scratch/tc-testing/tc-may-17/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -O3 red.c -o red.out
during GIMPLE pass: phiopt
./red.c: In function 'g':
./red.c:14:1: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85
   14 | }
      | ^
0xb17187 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../../gcc/gcc/tree.cc:9045
0xa40033 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../../gcc/gcc/tree.h:3779
0xa40033 useless_type_conversion_p(tree_node*, tree_node*)
        ../../../gcc/gcc/gimple-expr.cc:85
0x1378e92 verify_gimple_assign_binary
        ../../../gcc/gcc/tree-cfg.cc:4309
0x13841de verify_gimple_in_cfg(function*, bool, bool)
        ../../../gcc/gcc/tree-cfg.cc:5614
0x11fff20 execute_function_todo
        ../../../gcc/gcc/passes.cc:2089
0x120046b execute_todo
        ../../../gcc/gcc/passes.cc:2143
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/o187xKdP1

Affects x86, arm, risc-v.

Found via fuzzer.=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic