From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BEEAD3858CD1; Tue, 2 Apr 2024 23:43:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEEAD3858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712101419; bh=/sBNS0xdPgi2BJd/KbCLJaLK6R2I7P5JBZlOYj/kR1I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IjR9GS2sP6oizlgvACpbzUlZnKEjQrto7FF+JMJhjzk6QCsAl54wIga2/bEBnuflg H7bY4/zvGHKVUGexRkPiPklnIlcyorvM6/AahWVvc92L6E7fzOsqMVCaXPrFK0ijX1 Y7pVI+Rc4cwWdoWqMTiDAFeFAvZrOPw5o5ujyKYA= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114551] [14 Regression] wrong code at -O3 on x86_64-linux-gnu since r14-2944 Date: Tue, 02 Apr 2024 23:43:39 +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: needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned 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=3D114551 --- Comment #3 from Andrew Pinski --- The first major difference with/without continue is the moving of `f > (2147483647 - a)` checkout of the loop via lim2 in the case of not having t= he continue. You can replace the inner most loop with: ``` for (; c < 4; c++) { [[unlikely]]; d =3D f && a > 0 && f > (2147483647 - a) ? 0 : b[f]; } ``` Also so yes it is the continue predictor that is coming into play.=