From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 419813858CD1; Wed, 5 Jul 2023 06:55:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 419813858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688540155; bh=ZgJbS9A5Vr2NxdVbamOgiSiI6DlXWkHowrVZ7hb1fKs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sefWDpHM31NQlmaolf+imIggM5dA4aWHYQevHDfHKJsWMZ52swGeQkcohctNMftHL /CsKZobStVkmCOWLGtSQ1TGl59XwlcatndQxGN9GidlOQ1prgMjhUWuM4Bln2ldl6c ddrQh7aY6DTZZKrgnzdHKYobA254z42yDJ5MBO0w= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110541] Invalid VEC_PERM_EXPR mask element size Date: Wed, 05 Jul 2023 06:55:54 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: 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: assigned_to everconfirmed cf_reconfirmed_on bug_status 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=3D110541 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org Ever confirmed|0 |1 Last reconfirmed| |2023-07-05 Status|UNCONFIRMED |ASSIGNED --- Comment #1 from Richard Biener --- The restriction as documented in tree.def applies to non-constant MASKs onl= y, the case for constant MASKs was relaxed. Like /* Vector permutation expression. A =3D VEC_PERM_EXPR means N =3D length(mask) foreach i in N: M =3D mask[i] % (length(v0) + length(v1)) A[i] =3D M < length(v0) ? v0[M] : v1[M - length(v0)] V0 and V1 are vectors of the same type. When MASK is not constant: MASK is an integer-typed vector. The number of MASK elements must=20 be the same with the number of elements in V0 and V1. The size of=20 the inner type of the MASK and of the V0 and V1 must be the same. When MASK is constant: MASK is an integer-typed vector. MASK elements outside of=20 [0, length(V0) + length(V1) - 1] invoke undefined behavior (the=20 modulo operation above doesn't apply). */ DEFTREECODE (VEC_PERM_EXPR, "vec_perm_expr", tcc_expression, 3) I will submit this change.=