From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by sourceware.org (Postfix) with ESMTPS id BAA4D3858D32 for ; Wed, 19 Jul 2023 07:14:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BAA4D3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-403f3890a8eso16236591cf.3 for ; Wed, 19 Jul 2023 00:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689750854; x=1692342854; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=opKMp6XOIcmy6IWkkzBZfcNO+19LNZTPDJPA1QY+BkE=; b=JW2hiqL6hL2QQU5z/lP7/fOc7CbmvD11+Pxk3f5wVxUH48DubooL9i/hOCeU7CsAjq vG+vk41qQ712IjOX5aSo/MfW9QFa15SAKVVupo56VnjSce97rlD9PFN32WOJdqjvPZOX ddnHHQdJJ4F28drhqGHu6gtK8wo3o3mw5EhOaqChRvJGKl0I2G/2A0tjPufWOZFLQxrz 1foGHsPcG35gWYyrTFGwwIvBTtwOUr8P9w2SfDr3rwHQuNfqKXq9ChFpB6xxkyZLkpp+ F88Nb+Bsu2xUeBVvqkii0mgUOXfMg0oULVt/MTRFSVJK8I7Zv2/bFNfELT5iehuqfBDL LTVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689750854; x=1692342854; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=opKMp6XOIcmy6IWkkzBZfcNO+19LNZTPDJPA1QY+BkE=; b=dW8P5hX/OTgKNX02K87DwCBgVumK3OdJFHyygaZFBTdwe7ouK4euEXCjKfMLFxQDjO 9ahHcdYXOihl7IdD4mAupsiRL76+95F2LSegYK8l2G5NB696E8QYxPI92j7gfpicyfO6 iX+LXmfCxLCHEmyE3zi5ikymRt61Rt0tKB8wKR9oD12Y/0JpGIN+SrjuJjuyhfOgNmtN 0Wp56MSF31Im7wb0dv2BmzsLJ5P1xdvj4Y+UkM2LujEF3dAABG4WD0EI+T43gQxZbcg8 Bx9PdEwnyUVQciQ8puoIv8BbEZhsnD8aF/LTiASWKrwj0o1tEOSzg3s2IxvfnikQnJmv HyQw== X-Gm-Message-State: ABy/qLZd5d3a8n9nEnoSorzCxt24Q2W6RCbw+4xllR/90HLmKhtwYJbu qoE9KWvLVIGygZrZ4DNg3YqkuOL5Mo4uuP3gp/9Mbr7fUSg= X-Google-Smtp-Source: APBJJlFiecE7vAKF5w6v7abxsVIod+XQs4XmPdpkpYeJm3kgo+so/AHTQT6whbIllapBfFBTnJ6NWOoNM3ErgHVRSLs= X-Received: by 2002:a05:622a:1710:b0:403:788f:5d0d with SMTP id h16-20020a05622a171000b00403788f5d0dmr2306008qtk.0.1689750854423; Wed, 19 Jul 2023 00:14:14 -0700 (PDT) MIME-Version: 1.0 From: Julian Waters Date: Wed, 19 Jul 2023 15:13:37 +0800 Message-ID: Subject: [Bug] Attributes cannot be applied to asm statements To: gcc-help@gcc.gnu.org Content-Type: multipart/alternative; boundary="0000000000006fd94a0600d1c761" X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --0000000000006fd94a0600d1c761 Content-Type: text/plain; charset="UTF-8" Sorry for posting this here, I am unable to create an issue in the gcc tracker Consider the following: [[gnu::no_reorder]] asm ("nop"); The correct gcc warning should be that "attributes in front of statements are ignored", signifying that the asm was correctly processed as a statement, and the attribute dropped during that processing, but instead: error.cpp:51:5: error: expected primary-expression before 'asm' 51 | asm ("nop" "\n\t" | ^~~ error.cpp:50:5: warning: attributes at the beginning of statement are ignored [-Wattributes] 50 | [[gnu::no_reorder]] | ^~~~~~~~~~~~~~~~~~~ The compiler errors out, with the parser strangely having expected an expression after the attribute. Afterwards, it then confusingly parses the asm statement and discards the attribute correctly, so I am fairly certain this is a bug. The attribute above may not be a very good example, but there are attributes like gnu::hot and gnu::cold which are supposed to work with asm statements. Could someone help me post this to the bug tracker? Thanks in advance best regards, Julian --0000000000006fd94a0600d1c761--