From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E32B7385021E; Fri, 24 Jun 2022 10:29:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E32B7385021E From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106063] [13 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:281 with -O2 -fno-tree-forwprop --param=evrp-mode=legacy-first Date: Fri, 24 Jun 2022 10:29:17 +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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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: everconfirmed bug_status cc cf_reconfirmed_on 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2022 10:29:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106063 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW CC| |tnfchris at gcc dot gnu.org Last reconfirmed| |2022-06-24 --- Comment #2 from Richard Biener --- Interestingly typedef __int128 __attribute__((__vector_size__ (16))) V; typedef unsigned __int128 __attribute__((__vector_size__ (16))) uV; typedef V bV __attribute__((vector_mask)); V __GIMPLE (ssa,startwith("isel")) foo (V v) { uV _1; bV _2; V _4; __BB(2,guessed_local(1073741824)): _1 =3D __VIEW_CONVERT (v_3(D)); _2 =3D _1 <=3D _Literal (uV) { _Literal (unsigned __int128) 15 }; _4 =3D _2 ? _Literal (V) { _Literal (__int128) -1 } : _Literal (V) { 0 }; return _4; } works, even with -fdisable-tree-veclower21 The issue is that we cannot expand the unsigned comparsion _2 =3D _1 <=3D {= 15 }; which is introduced in VRP2 from the equality compare: --- t2.c.197t.threadfull2 2022-06-24 12:25:08.204648605 +0200 +++ t2.c.198t.vrp2 2022-06-24 12:25:08.204648605 +0200 @@ -10,13 +10,15 @@ ;; 2 succs { 1 } V foo (V v) { + vector(1) uint128_t _1; vector(1) _2; V _4; vector(1) __int128 _6; [local count: 1073741824]: _6 =3D v_3(D) & { -16 }; - _2 =3D _6 =3D=3D { 0 }; + _1 =3D VIEW_CONVERT_EXPR(v_3(D)); + _2 =3D _1 <=3D { 15 }; _4 =3D VEC_COND_EXPR <_2, { -1 }, { 0 }>; return _4; but after vector lowering only vector operations that are handled by the target may be introduced. The pattern /* Transform comparisons of the form (X & Y) CMP 0 to X CMP2 Z where ~Y + 1 =3D=3D pow2 and Z =3D ~Y. */ (for cst (VECTOR_CST INTEGER_CST) (for cmp (eq ne) icmp (le gt) (simplify (cmp (bit_and:c@2 @0 cst@1) integer_zerop) (with { tree csts =3D bitmask_inv_cst_vector_p (@1); } (if (csts && (VECTOR_TYPE_P (TREE_TYPE (@1)) || single_use (@2))) (if (TYPE_UNSIGNED (TREE_TYPE (@1))) (icmp @0 { csts; }) (with { tree utype =3D unsigned_type_for (TREE_TYPE (@1)); } (icmp (view_convert:utype @0) { csts; })))))))) fails to check that in the vector case. Caused by r12-5650-g29df53fe349073 (thus latent on the branch).=