From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 67F2B3858CDB; Mon, 6 Feb 2023 09:56:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 67F2B3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675677410; bh=2fvIWtuAR12PPz2TkR8RNc0piifdHIqP8/KcdoFxFx4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lYLRMA/m8NvJCoU0wGjBwsxbtTiJzcqvShpNvH94hcFB6lt2uJ5Hsh1cgzLOCEcZd egEwgePa9haWyKa8wQ1eTHTaLeREZa+lo4SrEJXsOKZJHBQHUWXHbV10cfRq8EMTSz 7SPDNl1JeWI7mUD1oOFgR8TTuIlIJirgXNV+/Bv4= From: "jakub 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 09:56:50 +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: jakub 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 #7 from Jakub Jelinek --- (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? I think it needs both. The thing is, when it returns the second time, it d= oes that again by returning from itself, not through returning from some unrela= ted 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 away, 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); 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 t= he abnormal edges that that other call can pass control back to the start of the returns_twice call to make it return again.=