From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 234003939C2E; Mon, 3 May 2021 07:13:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 234003939C2E From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100382] [12 Regression] go.test/test/fixedbugs/issue16095.go hang since r12-248 Date: Mon, 03 May 2021 07:13:14 +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: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Mon, 03 May 2021 07:13:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100382 --- Comment #3 from Richard Biener --- With the following patch this "issue" would show. Not sure why we think a postdom walk is appropriate for DSE rather than a reverse program order o= ne. diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index aecf6ab8c46..5bb5adf43c6 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see #include "builtins.h" #include "gimple-fold.h" #include "gimplify.h" +#include "cfganal.h" /* This file implements dead store elimination. @@ -1280,7 +1281,16 @@ pass_dse::execute (function *fun) /* Dead store elimination is fundamentally a walk of the post-dominator tree and a backwards walk of statements within each block. */ dse_dom_walker walker (CDI_POST_DOMINATORS); - walker.walk (fun->cfg->x_exit_block_ptr); + //walker.walk (fun->cfg->x_exit_block_ptr); + int *rpo =3D XNEWVEC (int, n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCK= S); + auto_bitmap exits; + edge entry =3D single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (fun)); + bitmap_set_bit (exits, EXIT_BLOCK); + int n =3D rev_post_order_and_mark_dfs_back_seme + (fun, entry, exits, true, rpo, NULL); + for (int i =3D n; i !=3D 0; --i) + walker.before_dom_children (BASIC_BLOCK_FOR_FN (fun, rpo[i-1])); + free (rpo); free_dominance_info (CDI_POST_DOMINATORS); unsigned todo =3D walker.todo ();=