This is the mail archive of the gcc-patches@gcc.gnu.org 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: [PATCH] Fix "naked" attribute (PR target/44290)


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.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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