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


On 03/02/2015 08:04 PM, Andres Tiraboschi wrote:
>> 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)

-O0 is the default.

If you want optimization, you have to turn it on.



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