Re: Body of inline function in cpp file and link time optimizations (LTO)

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

 



On Mon, Nov 16, 2009 at 08:33, Godlike God
<godlike_panos_hot@xxxxxxxxxxx> wrote:

> First question: Will gcc be able to understand and make this kind of small functions inline (with -O3 for example)?

If the body of the function is around at the time when GCC is doing
inlining decisions, yes.  This may mean that you need to use -flto or
put the bodies of the functions in a file that you #include (and mark
the functionst 'static inline').


> I read about Link Time Optimizations and -flto but it seems this is a new feature (I cannot use it yet).
>
> Second question: If I convert my code and ditch every inline I have, will -flto make the small functions inline for me?

It should, yes.  If you get a chance, I would suggest building a
snapshot of GCC 4.5 (available at http://gcc.gnu.org/snapshots.html)
and give it a try.


Diego.

[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