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: Problem with functions not being inlined


But passing those flags I listed above, why the compiler is not doing
those optimizations?
Why am I not getting any warnings?

2015-03-02 16:43 GMT-03:00 Andrew Haley <aph@redhat.com>:
> On 03/02/2015 07:35 PM, Andres Tiraboschi wrote:
>> Are the -finline-functions, -finline-functions-called-once and
>> -finline-small-functions flags enough?
>> Why am I having no warnings even with the -Winline flag enabled?
>
> GCC doc:
>
> 6.39 An Inline Function is As Fast As a Macro
>
>  GCC does not inline any functions when not optimizing unless you
> specify the `always_inline' attribute for the function, like this:
>
>      /* Prototype.  */
>      inline void foo (const char) __attribute__((always_inline));
>
> Andrew.
>


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