From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 043133857C52; Fri, 22 Oct 2021 10:32:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 043133857C52 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102895] [12 Regression] Dead Code Elimination Regression at -O3 (trunk vs 11.2.0) Date: Fri, 22 Oct 2021 10:32:17 +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: rguenth 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: target_milestone keywords everconfirmed cc 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: Fri, 22 Oct 2021 10:32:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102895 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |12.0 Keywords| |missed-optimization Ever confirmed|0 |1 CC| |aldyh at gcc dot gnu.org Last reconfirmed| |2021-10-22 Status|UNCONFIRMED |NEW --- Comment #1 from Richard Biener --- There's identical IL before the vrp2 pass (the one after strlen) but on the= GCC 11 branch vrp2 eliminates the call to foo while on trunk it does not. On the branch VRP registers Registering jump thread: (2, 3) incoming edge; (3, 4) normal; which elides the call but vrp-thread2 does not do this: Registering value_relation (_5 > a.4_4) (bb5) at _5 =3D a.4_4 + 1; Registering value_relation (_19 > a.4_13) (bb4) at _19 =3D a.4_13 + 1; [4] Registering jump thread: (2, 3) incoming edge; (3, 4) normal; Failure in thread_through_loop_header: Cancelling jump thread: (2, 3) incoming edge; (3, 4) normal; on the branch this threading destroys the loop structure=