This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __attribute__((naked) on x86 would be useful
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc at gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Mon, 16 Feb 2004 11:41:02 +0000
- Subject: Re: __attribute__((naked) on x86 would be useful
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
>
> 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.