From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5BA0338618A1; Tue, 10 Oct 2023 11:49:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BA0338618A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696938579; bh=95IKjC/0GMF8XUtwPOkNdr8KqXACVOYjGl2PTcLOjv8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bSE2EPbIUj3pkX8Y9BT126P7pB4h6rfGtR4Wd0Xyn6V9Q8TULwyOxPwsf6xwBs7ms k0qX4fNsFXCdMx+PUJRbhkX7LW2WEZgSdWDrgzd52d6CepvksJSpcrhcM4tZ4PKkFE 9Mft2rZOQzDaCwZ3s/0QRUSxyga+783OrLG5mLZQ= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111751] RISC-V: RVV unexpected vectorization Date: Tue, 10 Oct 2023 11:49:39 +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: rguenth at gcc dot gnu.org 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 #16 from Richard Biener --- (In reply to JuzheZhong from comment #14) > Also this case ICE: >=20 > typedef unsigned char __attribute__((vector_size(4))) uvec; >=20 > 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 }; >=20 > #define uc0_ ((unsigned char *)&uc0) >=20 > 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; > } >=20 > 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 >=20 >=20 > Looks odd, it ICE at gimple-isel.cc: >=20 > gcc_assert (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (op0)) I have a fix for the first issue. For this one the issue seems to be that we do have vec_cmp for _2 > { 0, 3, 2, 200 } when doing instruction selection for mask__11.18_97 =3D VEC_COND_EXPR ; note the value is of vector boolean type. But we fail to have vcond_maskV4BIV4BI. ISTR we have fixed sth similar by adding missing patterns with VnBImode result? But maybe forgot about VLS modes here?=