From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D6AFC3858D1E; Tue, 31 Oct 2023 19:23:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6AFC3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698780193; bh=hKnjVfjOtOgPMZpH6cxQIfa9GUCKFTkRq7k5iqIbcP4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oRAt8Mk6xRGLqIksy6GyMyRbYye4ZsSKhN3uZo1Z0y+Ad/7IONfPmVc5D3AJS4TFe PwaDy686R24MaXE1KRGxpehDcPw3FbHHx9l+0tJthNRoFcwYxSkDMgUOrOZ7G6Ut+Y 99QwjhilFY7S4Ou/YExB0YT1I4iyDLGps5BcFHcw= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112312] -O3 produces worse code than -O2 for std::ranges::lower_bound in some cases, not marking a loop as finite Date: Tue, 31 Oct 2023 19:23:13 +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: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on everconfirmed short_desc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112312 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-10-31 Ever confirmed|0 |1 Summary|-O3 produces worse code |-O3 produces worse code |than -O2 for |than -O2 for |std::ranges::lower_bound in |std::ranges::lower_bound in |some cases, not removing an |some cases, not marking a |empty loop |loop as finite Status|UNCONFIRMED |NEW --- Comment #3 from Andrew Pinski --- Confirmed. So further difference is the loop seems not to be marked as finite while wi= th -O2 (or the non-lamdba version) is. Someone will need to figure out if and where we lose the idea of the finite loopness.=