inline bug (?)
Jorge PEREZ
jorge.perez@invia.fr
Wed Dec 1 13:44:00 GMT 2010
For what is worth I did the test again but this time I separated the
main and f1 in two separate C files. I compiled them separately and then
linked them together. This time the function was never inlined (even if
there is just one or two calls, i.e. NC=1 or 2).
Weird huh?
PS: main and f1 were defined in
http://gcc.gnu.org/ml/gcc-help/2010-11/msg00201.html
jorge.perez@invia.fr wrote:
> Thans for your comments guys, I'll follow your suggestions and try other examples and test additional options as well.
>
> I forgot to precise however that I used the option -os (optimizing for size)
>
> Regards
>
>
> Jorge
>
> In addition to the comments from Eric:
> On Wed, Nov 17, 2010 at 06:53:28PM +0100, Eric Botcazou wrote:
>
>>> I appreciate any feedback or suggestions you have about this, maybe I'm
>>> doing it all wrong from the begining, but the fact that inline increases
>>> the size of the code was weird to me.
>>>
>> The inlining heuristics are complex and tuned for real programs, so it's
>> probably easy to fool them with toy examples. Modifying them generally
>> requires a lot of retuning efforts so isn't a small undertaking.
>>
> If you are not happy with the way gcc inlines "by default", you can
> influence the inlining heuristics by many parameters / compile options,
> like: large-function-insns, large-function-growth,
> inline-unit-growth,...
> There is a long list in the manpage ;-)
>
> Axel
>
>
More information about the Gcc-help
mailing list