This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Disable all optimization options in GCC
- From: Mohamed Boussaa <mohamedboussaa3 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 22 Oct 2015 16:46:30 +0200
- Subject: Re: Disable all optimization options in GCC
- Authentication-results: sourceware.org; auth=none
- References: <CADEOxiNzOK65QoDvq+xrBDCDf1MTc2XHWUo4khCsu_PTwyj4Zw at mail dot gmail dot com>
To answer my question, I have made some conclusions and assumptions:
So let me say that compiling with O0 does not mean that no
optimizations will be applied. Options that reduce compilation time
and make debugging better will be turned on.
In other words, O0 is optimizing in the level of compilation. Produced
binaries are not optimized in order to ease debugging process.
I give an example: This option is enabled at O0 level
-faggressive-loop-optimizations
In GCC documentation:
This option tells the loop optimizer to use language constraints to
derive bounds for the number of iterations of a loop. This assumes
that loop code does not invoke undefined behavior by for example
causing signed integer overflows or out-of-bound array accesses. The
bounds for the number of iterations of a loop are used to guide loop
unrolling and peeling and loop exit test optimizations. This option is
enabled by default.
So for GCC 4.8.x, there are almost 50 options turned on by default.
Can someone confirm that?