From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A8CFF3858C5E; Thu, 3 Aug 2023 16:00:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8CFF3858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691078444; bh=5RV3gpa39ejm2xNwz4XOPc2eIT/8+VxuTTbA9QX3m9s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=id92b2igUol1NOYfuqI9gyI5+qbOUS+Ea82pZRxCLb6F+GZBORONwHsvdiGhWBs2N sa0/jNgVbjk9Mznh+CMqWIxVIY6xppl7X0Q0WPJcdrqCWx3EeL9ourLu+BeBIUWMFj /g3grSWZ7cubZ6N6Et9GyC9SmcFm1Ud7zPAd9EqQ= From: "ndesaulniers at google 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 16:00:44 +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: ndesaulniers at google 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 #10 from Nick Desaulniers --- (In reply to Michael Matz from comment #9) > That has to do with how we need to (possibly) > split > critical edges, which changes label identity, which in turn might actually > be the thing that's required by the asmgoto. (Addressing just this point for now.) I don't think that's a problem for users of asm goto; GCC (and Clang) will already split critical edges when using asm goto with outputs (thus creating the case you describe where the label that the asm will jump to has been synthesized and may differ from the final actual destination). For example: ```c void bar (void); int foo (int y) { int x; if (y) goto end; asm goto ("# %1 %2":"=3Dr"(x):"i"(&&end)::end); bar(); return 0; end: return x; } ``` in the above, %1 may not equal %2. I documented this behavior in clang https://github.com/llvm/llvm-project/commit/329ef60f3e21fd6845e8e8b0da405ca= e7eb27267#diff-ec770381d76c859f5f572db789175fe44410a72608f58ad5dbb14335ba56= eb97 which will be in the clang-17 release notes once clang-17 ships (currently = in -rc). I also don't see that being a problem for the Linux kernel at the moment, though they may need to consider that behavior.=