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]

Re: Function Prolog / Epilog


Hello

Nick Clifton schrieb:
> 
> Hi Dave,
> 
> : > I know of no generic way of doing this.  The ARM port supports a
> : > machine specific attribute called "naked" which does exactly what you
> : > want, so maybe you will be able to use that code as a template for
> : > modifying whichever port you use.
> : >
> :
> : Is there some sort of a wish list so one could mention such
> : a new "naked" attribute as a proposal to implement in all future
> : egcs version, if it is not already planned.  I'm surely not the only
> : person for which such a feature would be useful.
> 
> Not really.  There are basically three ways to get this feature
> implemented:
> 
>    1. Do it yourself.  Then submit the patch(es) to egcs-patches and
>       bask in the glow of a job well done.
> 
>    2. Pay someone to do it for you.  Naturally for a price Cygnus
>       would implement this feature for you... :-)
> 
>    3. Try to find someone else who wants this feature and persuade
>       them to implement it.
> 
> Cheers
>         Nick

Ok, i choose number 1 and made a quick hack in the M68K backend 
to have access to the "naked" function attribute. The 
implementation idea is the same as in the ARM backend as 
mentioned by Nick Clifton.

But i think, it would be better idea to to handle a "naked"
function attribute in the "higher" levels of the compiler
than in the various backends (e.g. like "noreturn" attribute).
Any other opinions ??

Is there a formal definition (besides the source code ;-)) what
the "emit_prolog", "emit_epilog" functions in the backends
are allowed to do and what not.

If they ("emit_prolog", "emit_epilog) don't have nasty side effects,
then it should be possible to suppress the call to "emit_prolog" and
"emit_epilog" when the compiler parses the intermediate representation
of the source code and changes are only neccessary in own central place
and not in all backends. 

At least this is my idea of what's to do. Am i correct??  


Dave


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