This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with functions not being inlined
- From: Andrew Haley <aph at redhat dot com>
- To: Andres Tiraboschi <andres dot tiraboschi at tallertechnologies dot com>, gcc-help at gcc dot gnu dot org
- Date: Mon, 02 Mar 2015 19:43:40 +0000
- Subject: Re: Problem with functions not being inlined
- Authentication-results: sourceware.org; auth=none
- References: <CAJZwELkcjQXaSO1FWPyBCXFSbS2g0Pnndrqhb-YU5C45fZ3j0g at mail dot gmail dot 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.