Re: inline bug (?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jorge PEREZ wrote:
> Eric Botcazou wrote:
>   
>>>  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).
>>>     
>>>       
>> You need LTO (-flto) to inline between different compilation units.
>>
>>   
>>     
> Not sure if I understood right, but I compiled with -flto in both cases.
> Actually it's good that it didn't inline this time because I compiled
> with -Os too and inlining would make the code size bigger. It's weird
> though that when compiling main and f1 together, f1 is inlined up to 5
> times increasing dramatically the code size.
>
>   
I replied too fast, sorry.

Just wanted to add that moreover, when main and f1 are compiled together
it has different behaviors if they are in separate files or in the same
file.

When in different files, no inline is done (this is good)
When in the same file, inline is done up to 5 times (weird and bad for
code size)

I used -flto and -Os everytime.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux