From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9D74038515F0; Thu, 25 Mar 2021 11:57:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D74038515F0 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99767] [9/10/11 Regression] ICE in expand_direct_optab_fn, at internal-fn.c:3360 Date: Thu, 25 Mar 2021 11:57:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-invalid-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: 9.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone bug_status everconfirmed 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: Thu, 25 Mar 2021 11:57:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99767 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |9.4 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2021-03-25 --- Comment #1 from Richard Biener --- OMP lowering makes the dead division conditional and we produce and want to expand ;; basic block 2, loop depth 0 ;; pred: ENTRY MEM [(int *)&mask.4] =3D mask.5_9(D); vect__5.21_31 =3D .MASK_LOAD (&mask.4, 32B, { -1, -1, 0, 0, ... }); _5 =3D mask.4[0]; mask__26.22_33 =3D vect__5.21_31 !=3D { 0, ... }; _26 =3D _5 !=3D 0; v_1 =3D .COND_DIV (_26, 1, 0, 1); vec_mask_and_37 =3D mask__26.22_33 & { -1, -1, 0, 0, ... }; .MASK_STORE (&retval.3, 32B, vec_mask_and_37, { 0, ... }); vectp_mask.19_29 =3D &mask.4 + POLY_INT_CST [16, 16]; vectp_retval.23_36 =3D &retval.3 + POLY_INT_CST [16, 16]; _6 =3D VIEW_CONVERT_EXPR(retval.3); return _6; ;; succ: EXIT but that's still scalar, so sth forgot to "vectorize" it? Indeed when returning 'v' we instead get _26 =3D _5 !=3D 0; vec_mask_and_37 =3D mask__26.34_33 & { -1, -1, -1, -1, 0, 0, 0, 0, ... }; vect_v_1.35_38 =3D .COND_DIV (vec_mask_and_37, { 1, ... }, { 0, ... }, { = 1, ... }); .MASK_STORE (&retval.9, 32B, vec_mask_and_37, vect_v_1.35_38); The .COND_DIV is generated by if-conversion which supposedly expects we will vectorize it (or throw it away) but it doesn't ignore (as the vectoriz= er) obviously dead stmts. So the bug is this disconnect between if-conversion and vectorization.=