Re: Force inline without -O2

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

 



On 12/29/2009 01:31 AM, Thomas Martitz wrote:
Am 28.12.2009 13:30, schrieb Jie Zhang:
On 12/28/2009 08:21 PM, Thomas Martitz wrote:
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.

GCC uses -O0 by default, not -O1.


Jie

Hmm, ok, but it doesn't inline functions marked with
__attribute__((always_inline)) with -O0. I tried that with gcc 4.4.2 for
the arm-eabi target. Maybe it's a bug then, or maybe the manual means -O
for "no optimization level specified"?

Do you have a test case to show this issue?


Jie

[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