From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7392E3858D35; Tue, 10 Oct 2023 11:23:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7392E3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696937020; bh=7ugxhCj40OmvmFn2C6lwtkv4eKFcAINzgR+IpnT8CZA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hCojLxFSpVa77n8QLzrJyLkOHNm8P/y/rE9PMrQEZkTWj8VIlozCh9/gHrC+OEM/e 0QIoP+zPWT0NSdyKnpc0pqrXKFYtKXs3G1sBNVDXGTtqxdyP3H3ReQfKAcRvk8Ua2z 3miDftl5nnX/btkv1Vz3L56axBRVsG2lw8MxIL5s= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111751] RISC-V: RVV unexpected vectorization Date: Tue, 10 Oct 2023 11:23:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: juzhe.zhong at rivai dot ai X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D111751 --- Comment #14 from JuzheZhong --- Also this case ICE: typedef unsigned char __attribute__((vector_size(4))) uvec; int main (int argc, char *argv[]) { int i; int x =3D 0; uvec uc0 =3D (uvec) {argc, 1, 2, 10}; unsigned char uc1[4] =3D {0, 3, 2, 200}; signed char ucg[4] =3D {1, 0, 0, 0 }; signed char ucl[4] =3D {0, 1, 0, 1 }; #define uc0_ ((unsigned char *)&uc0) for (i =3D 0; i < 4; i ++) { x |=3D ucg[i] !=3D (uc0_[i] > uc1[i]); x |=3D ucl[i] !=3D (uc0_[i] < uc1[i]); } return x; } during GIMPLE pass: isel dump file: auto.c.256t.isel auto.c: In function 'main': auto.c:3:5: internal compiler error: in gimple_expand_vec_cond_expr, at gimple-isel.cc:328 3 | int main (int argc, char *argv[]) { | ^~~~ 0x1bb55bd gimple_expand_vec_cond_expr ../../../../gcc/gcc/gimple-isel.cc:325 0x1bb57c6 execute ../../../../gcc/gcc/gimple-isel.cc:390 Looks odd, it ICE at gimple-isel.cc: gcc_assert (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (op0))=