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: Andres Tiraboschi <andres dot tiraboschi at tallertechnologies dot com>
- To: Andrew Haley <aph at redhat dot com>, gcc-help at gcc dot gnu dot org
- Date: Mon, 2 Mar 2015 17:04:55 -0300
- Subject: Re: Problem with functions not being inlined
- Authentication-results: sourceware.org; auth=none
- References: <CAJZwELkcjQXaSO1FWPyBCXFSbS2g0Pnndrqhb-YU5C45fZ3j0g at mail dot gmail dot com> <54F4BD6C dot 3030903 at redhat dot com> <CAJZwELmAxcf2KzSs0mLFJsd2tNw7ACVXgx4ZCLaPL1g0utxj+Q at mail dot gmail dot com> <54F4C0BE dot 5090502 at redhat dot com>
> On 03/02/2015 07:56 PM, Andres Tiraboschi wrote:
>> But passing those flags I listed above, why the compiler is not doing
>> those optimizations?
>
> Because you have said -O0. -O0 means no optimization.
>
> With -O0, all those other optimization options are ignored.
forget -O0, compiling this way I have exactly the same problem:
g++ -finline-functions -finline-functions-called-once
-finline-small-functions -ftree-coalesce-inlined-vars -Wall -Wextra
-pedantic -std=c++11 -Winline main.cpp
(is the same but without -O0)