public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "patrick at rivosinc dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/115143] New: [14/15 Regression] tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85
Date: Fri, 17 May 2024 21:29:16 +0000	[thread overview]
Message-ID: <bug-115143-4@http.gcc.gnu.org/bugzilla/> (raw)

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.

             reply	other threads:[~2024-05-17 21:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 21:29 patrick at rivosinc dot com [this message]
2024-05-18  2:00 ` [Bug tree-optimization/115143] " pinskia at gcc dot gnu.org
2024-05-18  2:22 ` pinskia at gcc dot gnu.org
2024-05-18 13:11 ` pinskia at gcc dot gnu.org
2024-05-18 13:12 ` [Bug tree-optimization/115143] [13/14/15 " pinskia at gcc dot gnu.org
2024-05-18 13:15 ` [Bug tree-optimization/115143] [11/12/13/14/15 " pinskia at gcc dot gnu.org
2024-05-18 13:27 ` pinskia at gcc dot gnu.org
2024-05-18 13:27 ` pinskia at gcc dot gnu.org
2024-05-18 14:04 ` pinskia at gcc dot gnu.org
2024-05-18 14:06 ` pinskia at gcc dot gnu.org
2024-05-18 14:10 ` pinskia at gcc dot gnu.org
2024-05-18 14:36 ` pinskia at gcc dot gnu.org
2024-05-18 23:12 ` pinskia at gcc dot gnu.org
2024-05-20 21:45 ` cvs-commit at gcc dot gnu.org
2024-05-20 21:57 ` cvs-commit at gcc dot gnu.org
2024-05-20 21:58 ` [Bug tree-optimization/115143] [11/12/13 " pinskia at gcc dot gnu.org
2024-05-21  9:20 ` jakub at gcc dot gnu.org
2024-05-21 14:32 ` cvs-commit at gcc dot gnu.org
2024-05-21 14:36 ` [Bug tree-optimization/115143] [11/12 " pinskia at gcc dot gnu.org
2024-06-11 17:19 ` cvs-commit at gcc dot gnu.org
2024-06-11 17:20 ` [Bug tree-optimization/115143] [11 " pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-115143-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).