From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DECF63858D3C; Mon, 13 Feb 2023 09:51:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DECF63858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676281914; bh=TAQmji46w96ZjpUbZw7pKdAdDzEJpseqYB7A0Q0bkHY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FrxG3UFgV+tYNjFP7re4H0qzMhSLQ9PWrGxa9bWI23X6SIsaZRipvW5HOefIFr+cK k7IjJjXv4oNX//NysfqZC+SswNRzY2/NQfwDO7VjnwRFx8iugmhRfBHvKsSVxiuy9Y Uvx+PGJpWl1u7obncQZlRoFg7JEEcOtZu5fRqAkU= From: "david.spickett at linaro dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108691] [13 Regression] ICE with function ptr and setjmp/returns twice at -O1 Date: Mon, 13 Feb 2023 09:51:54 +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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: david.spickett at linaro dot org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108691 --- Comment #7 from David Spickett --- > That still leaves us with missing abnormal edges - David, was this reduce= d from an actual program? No, it's a simplified version of the C used to generate an LLVM IR test cas= e: extern int setjmp(ptr); extern void notsetjmp(void); void bbb(void) { setjmp(0); int (*fnptr)(ptr) =3D setjmp; fnptr(0); notsetjmp(); } The test is checking that llvm follows each call to a returns twice function with a branch target identifier instruction. In case the function returns u= sing a jump instead of the normal ret. That's probably beside the point for this= bug though. The "real code" that motivated the feature was not doing indirect calls. I = just tested that because there's no reason it shouldn't also work. I don't know of a use case for code like this. Like you said, if the compil= er doesn't know what the indirect call target is, it won't know it's return tw= ice. If it does know what you're calling, you could probably just call it direct= ly. So I was just shuffling statements around to test clang and compare against= gcc and found the ICE that way.=