From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2B8023858D20; Fri, 17 May 2024 21:29:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B8023858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715981357; bh=iz1Qj2GOBuiP2x+fZE4BqYeldoUJezD5YaxCnmKldxQ=; h=From:To:Subject:Date:From; b=q/Az6tAEcqOfiqDKj3hYbdWR78oKkxs3wmEQLrOJ4jGWOagxIyyRCEa6kV4L7ZuMb N+/BLzGOrY0T6wQNKeXaUgjEycM2IJ/UITxAWNaAn0v8idXgADeXIMxrQdtXbmMsyM ASekXKOLvfbFHVr2OlZo7KbbjLJXQ1QKmLv11QIg= From: "patrick at rivosinc dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: patrick at rivosinc dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115143 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 =3D f ? ({ unsigned long i =3D d ? f : 0, j =3D 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', h= ave '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, ch= ar 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 for instructions. Godbolt: https://godbolt.org/z/o187xKdP1 Affects x86, arm, risc-v. Found via fuzzer.=