From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 637DD3896C29; Mon, 3 May 2021 06:51:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 637DD3896C29 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 06:51: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: 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 06:51:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100382 --- Comment #2 from Richard Biener --- Hum. OK, so DSE would also miss is_ctrl_altering_stmt (DCE checks this whi= ch covers stmt_can_throw_internal). So with non-call-EH we even want to prese= rve externally throwing EH? Given there's can_delete_dead_exceptions I wonder if this applies to call EH as well. Note for this to make a practical difference the throwing function would need to be pure at least (thus subje= ct to DCE in the first place). So - wouldn't a more consistent check be (!stmt_could_throw_p () || cfun->can_delete_dead_exceptions) ? int x, y; int __attribute__((pure,noinline)) foo () { if (x) throw; return y; } int main() { int a[2]; x =3D 1; try { int res =3D foo (); a[0] =3D res; } catch (...) { return 0; } return 1; } should show this but the post-dom domwalk is plagued by the same ordering issue as the dom domwalk was (we visit dom children in non-"RPO" order, in this case inverted postorder).=