From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8E1EC3947C2D; Fri, 28 Jan 2022 09:54:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E1EC3947C2D From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531 Date: Fri, 28 Jan 2022 09:54:07 +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: compare-debug-failure, 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: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 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: Fri, 28 Jan 2022 09:54:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104263 --- Comment #5 from Richard Biener --- OK, so with the abnormal edges the issue is that DCE1 removes the recursive call to foo () (because the function is "wrongly" pure) which causes us to clear cfun->calls_setjmp but then any further gimple_purge_dead_abnormal_call_edg= es will simply do nothing (as premature optimization one could guess). So the bug would be that we fail to wipe all abnormal edges when a function no longer calls setjmp or has a nonlocal label. The easiest fix is to remove the premature optimization in gimple_purge_dead_abnormal_call_edges. That leaves the abnormal edges from bar() even after DCE removes the recursive call to foo() (still a missed optimization) but it at least will not leave us with stray abnormal edges from non-call / non-computed goto stmts in the IL. It also resolves the compare-debug failure for this testcase (but maybe the= re's a latent issue in store-merging still).=