Re: inline functions

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

 



On Sat, Jun 4, 2016 at 11:59 AM, Muni Sekhar <munisekharrms@xxxxxxxxx> wrote:
> Hi,
>
> I tested with the below mentioned code("inline.c") to understand about
> inline functions.
>
> I explicitly instructed gcc to translate inline.c to inline.s.
>
> Next I removed the inline keyword from inline.c and re-created the
> inline.s file, but I don’t see any difference in the assembly code. Is
> it correct behavior?
>
> Could you guys point few good examples to understand the concept of inline?

Hi Muni,

    Probably gcc is automatic inlining your function even in the
absence of 'inline' keyword...

    Take a look here:

    http://www.cocoabuilder.com/archive/xcode/269025-how-to-disable-gcc-automatic-inlining.html

    And here:

    https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

    There are a few inline related flags, including this:

    -finline-functions-called-once
Consider all static functions called once for inlining into their
caller even if they are not marked inline. If a call to a given
function is integrated, then the function is not output as assembler
code in its own right.
Enabled at levels -O1, -O2, -O3 and -Os.

    Best regards,

-- 
Augusto Mecking Caringi

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux