From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8C4663858D1E; Mon, 6 Feb 2023 10:03:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C4663858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675677835; bh=B01Ey1DAf3OYTiMIxgwvVFs3eEE4J2PqA/oo0NYkDKY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GUcUhvHeM2nmi+VJqXhKaaDRhTct+PkJEcdD8uxfaRVzy92MnXm2LhMJnsReR+wQP DPH5XsV0BJlJk02iE7z/gk68AINYkb0xKHq1CTPSY9v89/PSVVQOpxPvhgbgxVCZB6 cg4DCeWQufr2sr5s+JbwAZzPR+rbfA0LreMWkwTY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/108656] [12/13 Regression] '-fcompare-debug' failure (length) w/ -O2 -fno-ipa-pure-const -fno-tree-dce --param early-inlining-insns=0 since r12-5236 Date: Mon, 06 Feb 2023 10:03:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: compare-debug-failure 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: 12.3 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108656 --- Comment #8 from Richard Biener --- (In reply to Jakub Jelinek from comment #7) > (In reply to Richard Biener from comment #6) > > (In reply to Jakub Jelinek from comment #5) > > > Created attachment 54412 [details] > > > gcc13-pr108656.patch > > >=20 > > > So shall we fix it like this then? > >=20 > > But isn't this the wrong "side"? returns_twice means it is the abnormal > > control _receiver_, it doesn't perform an abnormal goto itself. > >=20 > > stmt_starts_bb_p is correct here, so where does it go wrong? >=20 > I think it needs both. The thing is, when it returns the second time, it > does that again by returning from itself, not through returning from some > unrelated function. > Say, if we have pure + returns_twice call and no other call in a function, > the abnormal edge to the pure + returns_twice call would be optimized awa= y, > even when the call remains, because there would be no edge from some call= to > the .ABNORMAL_DISPATCHER block. > __attribute__((pure, returns_twice)) int foo (void); >=20 > int > bar (void) > { > for (int i =3D 0; i < 64; ++i) > { > int x =3D foo (); > if (x =3D=3D 26) > return -42; > } > return 42; > } > doesn't even have because of this any abnormal edges created. > Or, if there is some other non-pure call somewhere else, we model through > the abnormal > edges that that other call can pass control back to the start of the > returns_twice call to make it return again. Ah, but then the issue is that we assume that 'foo' doesn't longjmp, independent on whether it is returns_twice or not? Can a setjmp () function perform a longjmp () to its own context? Would it even appear as returning twice then? Would calling setjmp in a loop like above and then jumping to another iteration via longjmp even be valid? That said, for your example I would think not having any abnormal edges is correct - there's no frame that could transfer control back to the returns_twice receiver, no?=