This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inline funtcion of base class


On 20 August 2013 09:53, Hatt Tom wrote:
> Thanks for reply !
>
>
> I look into the disassembly instructions ,it show me that the call
> procedure of  B::func()  own its stack frame ,and its first
> instruction is push %ebp .
>
> so It is not dealed as a inline .

The compiler is not required to inline functions even if they're
declared as inline.  If you don't enable optimisations when compiling
there will be no function inlining.  Even with optimisations the
compiler might decide inlining the function would make it slower.

If you want to force the optimisers to inline it you can use the GNU
attribute always_inline.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]