From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2CAD2387088D; Thu, 22 Jul 2021 07:19:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2CAD2387088D From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101501] [11/12 Regression] wrong code at -O3 on x86_64-linux-gnu Date: Thu, 22 Jul 2021 07:19:12 +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: 11.1.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed cf_reconfirmed_on assigned_to bug_status 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, 22 Jul 2021 07:19:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101501 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2021-07-22 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org Status|UNCONFIRMED |ASSIGNED --- Comment #4 from Richard Biener --- niter analysis computes Analyzing # of iterations of loop 2 exit condition [a_lsm.5_10 * 52, + , 204] !=3D 0 bounds on difference of bases: -255 ... 0 result: # of iterations (a_lsm.5_10 * 52) / 52, bounded by 63 but then Loop 2 iterates at most 14 times. Loop 2 likely iterates at most 14 times. because we have nb_iterations_upper_bound set on the loop. That upper bound is set by the vectorizer which vectorizes the loop but then it's immediately removed again because the runtime profitability check optimizes to 1 !=3D 0= ?! With -fno-vect-cost-model things don't fare any better but -fno-tree-vector= ize fixes the issue.=