From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7C9F13858C62; Fri, 1 Dec 2023 05:43:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C9F13858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701409425; bh=V7YNxy2oR4rc/TbdCaJdAyKWL3MpeKrZVTQolxHXXAs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jbGEGpE8WeEn9/iaAlP3nxEQkuP8gmg28NajbUO4RF+DFDkft5pxGaSOWZgXSa7gB kFE1zJQH0e6owu7hRKS7FjlR1G9M517pDFGtldn5/QdX0gDzeKLefGZu42CgDTFe3E ISC21zUcgMjtQ6m/e7G//RbpOwJYZ/NE1djQKkaI= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110734] Attributes cannot be applied to asm statements Date: Fri, 01 Dec 2023 05:43:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: diagnostic, inline-asm X-Bugzilla-Severity: enhancement X-Bugzilla-Who: xry111 at gcc dot gnu.org X-Bugzilla-Status: WAITING 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: bug_status 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=3D110734 Xi Ruoyao changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |WAITING --- Comment #14 from Xi Ruoyao --- Wait a minute. [[gnu::no_reorder]] is a function or variable attribute, so it's just not intended to be used for an asm statement. Actually it won't = work for any statement: int x; int main() { [[gnu::no_reorder]] x +=3D 1; } gives: t.c: In function 'main': t.c:5:9: warning: 'no_reorder' attribute ignored [-Wattributes] 5 | x +=3D 1; | ^ We have "statement attributes" (fallthrough and assume) but the doc is clear that they can only be set on null statements, while asm statements are not = null statements. Now to me this is just an invalid PR. Or am I missing something?=