public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* [Bug] Attributes cannot be applied to asm statements
@ 2023-07-19  7:13 Julian Waters
  2023-07-19  7:41 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Julian Waters @ 2023-07-19  7:13 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bug] Attributes cannot be applied to asm statements
  2023-07-19  7:13 [Bug] Attributes cannot be applied to asm statements Julian Waters
@ 2023-07-19  7:41 ` Jonathan Wakely
  2023-07-19  7:44   ` Julian Waters
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2023-07-19  7:41 UTC (permalink / raw)
  To: Julian Waters; +Cc: gcc-help

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

On Wed, 19 Jul 2023, 08:15 Julian Waters via Gcc-help, <gcc-help@gcc.gnu.org>
wrote:

> Sorry for posting this here, I am unable to create an issue in the gcc
> tracker
>

Your account has been created now, please post the bug in the right place.

It sometimes takes more than 12 minutes for somebody to respond to the
account requests :-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bug] Attributes cannot be applied to asm statements
  2023-07-19  7:41 ` Jonathan Wakely
@ 2023-07-19  7:44   ` Julian Waters
  2023-07-19  7:47     ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Julian Waters @ 2023-07-19  7:44 UTC (permalink / raw)
  To: Jonathan Wakely, gcc-help

[-- Attachment #1: Type: text/plain, Size: 539 bytes --]

Yep, thought it was going to take much longer than that honestly. Oops...

On Wed, Jul 19, 2023 at 3:41 PM Jonathan Wakely <jwakely.gcc@gmail.com>
wrote:

>
>
> On Wed, 19 Jul 2023, 08:15 Julian Waters via Gcc-help, <
> gcc-help@gcc.gnu.org> wrote:
>
>> Sorry for posting this here, I am unable to create an issue in the gcc
>> tracker
>>
>
> Your account has been created now, please post the bug in the right place.
>
> It sometimes takes more than 12 minutes for somebody to respond to the
> account requests :-)
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bug] Attributes cannot be applied to asm statements
  2023-07-19  7:44   ` Julian Waters
@ 2023-07-19  7:47     ` Jonathan Wakely
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2023-07-19  7:47 UTC (permalink / raw)
  To: Julian Waters; +Cc: gcc-help

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

On Wed, 19 Jul 2023, 08:45 Julian Waters, <tanksherman27@gmail.com> wrote:

> Yep, thought it was going to take much longer than that honestly. Oops...
>

It sometimes does take longer. There are only three volunteers who deal
with the requests, so it depends how busy we are and when we happen to
check the emails.




> On Wed, Jul 19, 2023 at 3:41 PM Jonathan Wakely <jwakely.gcc@gmail.com>
> wrote:
>
>>
>>
>> On Wed, 19 Jul 2023, 08:15 Julian Waters via Gcc-help, <
>> gcc-help@gcc.gnu.org> wrote:
>>
>>> Sorry for posting this here, I am unable to create an issue in the gcc
>>> tracker
>>>
>>
>> Your account has been created now, please post the bug in the right place.
>>
>> It sometimes takes more than 12 minutes for somebody to respond to the
>> account requests :-)
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-19  7:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-19  7:13 [Bug] Attributes cannot be applied to asm statements Julian Waters
2023-07-19  7:41 ` Jonathan Wakely
2023-07-19  7:44   ` Julian Waters
2023-07-19  7:47     ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).