This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Doc update for attribute

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]