From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D14753858439; Sat, 30 Oct 2021 07:03:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D14753858439 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102981] [12 Regression] Dead Code Elimination Regression at -O3 (trunk vs 11.2.0) Date: Sat, 30 Oct 2021 07:03: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: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh 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: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed cf_reconfirmed_on 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: Sat, 30 Oct 2021 07:03:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102981 Aldy Hernandez changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2021-10-30 Status|UNCONFIRMED |NEW --- Comment #1 from Aldy Hernandez --- In the pre-loop threaders (ethread, thread1, threadfull1), we can't touch anything because it would cross loops, but by threadfull2 we should be able= to. There's a threadable path starting at the 2->6 edge here: [local count: 118111600]: # c_21 =3D PHI # ivtmp.16_8 =3D PHI a.1_26 =3D a; if (a.1_26 < 0) goto ; [89.00%] else goto ; [11.00%] but we don't because doing so would peel off an iteration. Hmmm, this is really old code. I'm going to have to think about this: // This is like path_crosses_loops in profitable_path_p but more // restrictive, since profitable_path_p allows threading the // first block because it would be redirected anyhow. // // If we loosened the restriction and used profitable_path_p() // here instead, we would peel off the first iterations of loops // in places like tree-ssa/pr14341.c.=