From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7E41F3858CD1; Thu, 28 Dec 2023 18:08:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E41F3858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703786890; bh=6sfZ163FaIDX2PPTFh2ZFSBVH/ul/EVc4aQ5gWVF7KY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=V6IgZPYYHapXBJD+Uckhv2OdvwF+X+9ZKjL/DR6Y2crsHaKdERY1rK2tNnQuE+OIB T2JWZL5+wGPu4FpAXLH6USXAru9gpSc2JVc8Ohu3mv2H64MHun+INSSyGl6rVY9HWq 757dG2wF8LPwaBLZv8XUwJIIiNaXo/couh0UKIMc= From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113137] [14 regression] Failed bootstrap with -O3 -march=znver2 Date: Thu, 28 Dec 2023 18:08:10 +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: tnfchris at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: tnfchris at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D113137 --- Comment #10 from Tamar Christina --- Ok, so this bug is simply fixed by: diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index f51ae3e719e..e7a5917bc4c 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -976,7 +976,8 @@ vec_init_loop_exit_info (class loop *loop) if (number_of_iterations_exit_assumptions (loop, exit, &niter_desc, NULL) && !chrec_contains_undetermined (niter_desc.niter)) { - if (!niter_desc.may_be_zero || !candidate) + tree may_be_zero =3D niter_desc.may_be_zero; + if ((may_be_zero && integer_zerop (may_be_zero)) || !candidate) candidate =3D exit; } } because niter_desc.may_be_zero is not a boolean but instead a tree that enc= odes a boolean. Due to this we were forcing much more complicated loops than required. How= ever we *should* be able to handle these complicated loops since we don't know w= hen they'll occur.. so I'll post a companion patch to fix those too.=