From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 135133858D1E; Thu, 3 Aug 2023 17:07:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 135133858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691082456; bh=nJlRvOMmDgdP+h79w4iMhxeZaIZxRNJ+VIQTbmBkldE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Lg2YHc+ID1AGLFXuHWsVfilL+CLILd/GClv9wcRnNrJ/jprOjBnKRPayPEoXW5nLj r8BBEHu+W4v629t+2FvYDhSGGmgX1DJHYQ9EzbGkUxY0ldMfYo/7OUZWhESfssqPtH Cj1/eBf7UFPNSFM5+ThWqFGlL9tWexMdyJsBDbrg= From: "rjmccall at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110728] should __attribute__((cleanup())) callback get invoked for indirect edges of asm goto Date: Thu, 03 Aug 2023 17:07:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: EH, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rjmccall at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D110728 --- Comment #12 from John McCall --- While it's theoretically possible to split a computed-goto edge, in practice you want to avoid doing so if you at all can, because the split-edge pattern defeats the interpreter optimization that's the primary purpose for computed goto to exist. Users should take care to ensure that their jumps are from a "neutral" scope instead. That's why Clang chose to diagnose computed gotos that potentially leave destructor/cleanup scopes instead of just making it work, and I expect we would continue doing that even if GCC started doing edge-splitting. `asm goto` is different, in my opinion, and that edge could productively be split. Clang isn't doing that right now only because diagnosing was the quickest path to correctness (as opposed to skipping the cleanup); I think we're looking into splitting as the more long-term solution.=