This is the mail archive of the
mailing list for the GCC project.
Re: RFC: Doc update for attribute
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: David Wohlferd <dw at LimeGreenSocks dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Andrew Haley <aph at redhat dot com>, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Tue, 20 May 2014 09:59:55 +0200
- Subject: Re: RFC: Doc update for attribute
- Authentication-results: sourceware.org; auth=none
- References: <53718DCF dot 4030303 at LimeGreenSocks dot com> <537647F8 dot 9060306 at redhat dot com>
Am 05/16/2014 07:16 PM, schrieb Carlos O'Donell:
On 05/12/2014 11:13 PM, David Wohlferd wrote:
After updating gcc's docs about inline asm, I'm trying to improve
some of the related sections. One that I feel has problems with
clarity is __attribute__ naked.
I have attached my proposed update. Comments/corrections are
In a related question:
To better understand how this attribute is used, I looked at the
Linux kernel. While the existing docs say "only ... asm statements
that do not have operands" can safely be used, Linux routinely uses
asm WITH operands.
That's a bug. Period. You must not use naked with an asm that has
operands. Any kind of operand might inadvertently cause the compiler
to generate code and that would violate the requirements of the
attribute and potentially generate an ICE.
There is target hook TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS that is intended to
cater that case. For example, the documentation indicates it only works with
optimization turned off. But I don't know how reliable it is in general. For
avr target it works as expected.