Re: Optimization, inline functions

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

 



On Fri, Jul 4, 2008 at 01:34, Lee, Newbie <utmw0@xxxxxxxxxxx> wrote:
> 0. Does 'gcc -O2' make functions inline?
>

Well, from your tests it sounds like it does.  It's probably
restricted to those cases where it's clearly beneficial, however.

> 1. Is function inlining is dangerous?
>

Dangerous? No.  But it does make incremental compiles possibly take
longer, and aggressive inlining makes the binary bigger, which can
actually make things slower.

> 2. Is 'gcc -O3 ' safe? (I heard -O2 is recommended)
>

Depends on the code.  -O3 contains things such as strict aliasing
which is one part of the standard that much code doesn't follow.  I
get the impression that "unsafeness" from -O3 is much more often a
result of UB in the code than from bugs in gcc.

HTH,
~ Scott

[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