Re: Force inline without -O2

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

 



Am 28.12.2009 04:22, schrieb Jie Zhang:
I think __attribute__((always_inline)) is used to inline functions
even not optimizing. Below is from GCC manual:

always_inline
     Generally, functions are not inlined unless optimization is
specified. For functions declared inline, this attribute inlines the
function even if no optimization level was specified.


That just means that it's inlined under the implicit default optimization level -O1 (that is what you get "if no optimization level was specified"). If you set -O0, it will not inline. I had problem where -O0 broke code that is depended on being inlined.

Best regards.

[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