From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5E065385802A; Tue, 23 Nov 2021 19:31:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E065385802A From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103388] [12 Regression] missed optimization for dead code elimination at -O3 (vs. -O2) Date: Tue, 23 Nov 2021 19:31:03 +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: 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc resolution bug_status cf_reconfirmed_on everconfirmed 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: Tue, 23 Nov 2021 19:31:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103388 Aldy Hernandez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at gcc dot gnu.org Resolution|DUPLICATE |--- Status|RESOLVED |NEW Last reconfirmed| |2021-11-23 Ever confirmed|0 |1 --- Comment #2 from Aldy Hernandez --- (In reply to Aldy Hernandez from comment #1) > By *.threadfull1 this is the path at 4->5->7. It looks like: >=20 > PREHEADER > | > v > HEADER--------+ > | | > V > UNREACHABLE | > | / > V / > return 0 <-+ >=20 > This is more or less PR102981. >=20 > Is there any way we can stop reporting the same thing over and over? >=20 > *** This bug has been marked as a duplicate of bug 102981 *** Errr, wait a minute, that's not a loop. My bad. We're failing to thread 4->5->xxx because: Checking profitability of path (backwards): bb:5 (10 insns) bb:4 Control statement insns: 2 Overall: 8 insns FAIL: Did not thread around loop and would copy too many statements. which is a limitation of the backward threader copier: /* The generic copier used by the backthreader does not re-use an existing threading path to reduce code duplication. So for that case, drastically reduce the number of statements we are allowed to copy. */ if (!(threaded_through_latch && threaded_multiway_branch) && (n_insns * param_fsm_scale_path_stmts >=3D param_max_jump_thread_duplication_stmts)) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, " FAIL: Did not thread around loop and would copy too " "many statements.\n"); return false; } Confirmed.=