[PATCH] Fix "naked" attribute (PR target/44290)

Jie Zhang jie@codesourcery.com
Fri Jul 23 09:11:00 GMT 2010


On 07/23/2010 05:59 AM, Mark Mitchell wrote:
> Jie Zhang wrote:
>
>> The "naked" attribute should imply "noinline" and "noclone". This patch
>> implements this for all the 5 targets which currently support the
>> "naked" attribute: ARM, AVR, MCORE, RX, SPU.
>
> I completely agree with the spirit of this patch.  "naked" functions are
> very weird things, and the compiler should be very cautious in doing
> things with them.  It shouldn't make copies of them (inline or clone)
> because we really have no way of knowing what's in there, including (for
> example) static data declared in assembly code.
>
> But, I think the implementation could be more architecture-independent.
>   I'm prepared to say that any architecture that supports the "naked"
> attribute *must* implement it with the semantics on the architectures
> you name above.  That means that the ${arch}_insert_attributes functions
> you have could be architecture-independent.  Just put that code into the
> architecture-independent attribute-processing function.
>
This is a good idea. The modified patch is attached. Is it OK now?


Regards,
-- 
Jie Zhang
CodeSourcery
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-fix-naked-2.diff
Type: text/x-patch
Size: 3211 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100723/17461657/attachment.bin>


More information about the Gcc-patches mailing list