This is the mail archive of the gcc@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: __attribute__((naked) on x86 would be useful


> 
> The largest mistake with "naked" is that if you write *any* non
> asm code at all in the function, then it won't work.  I might have
> seen the rationale for accepting exactly one old-style asm in a
> "naked" function, and emitting nothing else, but that's not the
> way that attribute has typically been enforced.
> 

I agree:  "naked" is an abomination. 

I wonder whether we should add a new type of asm -- asm_function?  
Something like

asm_function (func_name, "<asm-body>");

which can only be used at the top level.  GCC could then do what it does 
with naked, but the user can't break the limitations as they can with 
naked.

Once we have something like that we could deprecate naked and start the 
process of recovering from that mess.

R.


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