Patch to allow targets to prevent inlining
Jeffrey A Law
law@cygnus.com
Fri Feb 25 18:28:00 GMT 2000
In message <200002142333.PAA02776@elmo.cygnus.com>you write:
> Hi Guys,
>
> The patch below creates a new target macro which will allows
> individual backends to prevent inlining of particular functions.
>
> This ability is useful for the ARM an MCore ports which support
> naked functions (ie functions whoes prologues and epilogues are
> provided by the programmer, not the compiler). Such functions
> should not be inlined but currently there is no way to prevent
> this.
>
> Is it OK to apply this patch ?
>
> Cheers
> Nick
>
>
> 2000-02-14 Nick Clifton <nickc@cygnus.com>
>
> * integrate.c (function_cannot_be_inline_p): If defined invoke
> TARGET_CANNOT_INLINE_P as a final test of suitability for
> inlining.
>
> * tm.texi (Inlining): New node: Describe macro
> TARGET_CANNOT_INLINE_P.
You sent this to binutils... Opps :-)
While I can see the need for providing a way to keep certain functions from
being inlined, I'm not sure we've got the sense correct.
ie, I suspect most of the time if the target is supporting some target
specific attribute on a function, then the odds are if that attribute is
set we shouldn't inline the function. That's a gut feeling, I don't have
any data to back that up.
Anyway, based on that gut feeling I'd go the other way and have the compiler
default to not inline any function with an backend attribute attached to the
function. We might even find that we don't need an override for that default
behavior.
Other thoughts?
jeff
More information about the Gcc-patches
mailing list