From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 632DD3858001; Fri, 27 Aug 2021 09:00:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 632DD3858001 From: "guojiufu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102072] New test case gcc.dg/vect/pr101145_3.c in r12-3136 fails on armeb Date: Fri, 27 Aug 2021 09:00:09 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: guojiufu at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: 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, 27 Aug 2021 09:00:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102072 --- Comment #7 from Jiu Fu Guo --- For this case: it was generated as: l_12 =3D l_25 + 1; if (l_12 > n_13(D)) Here: cmp is ">", bound is "n_13", and "iv(base=3Dl_xx, step=3D1)". This hits the assert in determine_exit_conditions. For members of tree_niter_desc, the comments(as below) align with the asser= ts in determine_exit_conditions.=20 ------------ /* The simplified shape of the exit condition. The loop exits if=20=20= =20=20=20=20=20=20=20=20=20=20=20 CONTROL CMP BOUND is false, where CMP is one of NE_EXPR,=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 LT_EXPR, or GT_EXPR, and step of CONTROL is positive if CMP is=20=20= =20=20=20=20=20=20=20=20=20=20=20 LE_EXPR and negative if CMP is GE_EXPR. This information is used=20= =20=20=20=20=20=20=20=20=20 by loop unrolling. */ affine_iv control; tree bound; enum tree_code cmp; Current code the "control, bound and cmp" are set in number_of_iterations_l= t: if (integer_nonzerop (iv0->step)) {=20=20 niter->control =3D *iv0; niter->cmp =3D LT_EXPR; niter->bound =3D iv1->base; } else { niter->control =3D *iv1; niter->cmp =3D GT_EXPR; niter->bound =3D iv0->base; } This code may need to refine for the case "step until wrap condition".=