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: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Mohamed Boussaa <mohamedboussaa3 at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 22 Oct 2015 19:30:47 +0100
- Subject: Re: Disable all optimization options in GCC
- Authentication-results: sourceware.org; auth=none
- References: <CADEOxiNzOK65QoDvq+xrBDCDf1MTc2XHWUo4khCsu_PTwyj4Zw at mail dot gmail dot com> <CADEOxiNjVvDN2ais42Q7rwkmy4MH5zmE8gp+Ok7OPefng0d8Zg at mail dot gmail dot com>
On 22 October 2015 at 15:46, Mohamed Boussaa <mohamedboussaa3@gmail.com> wrote:
> 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.
Wrong.
> Options that reduce compilation time
> and make debugging better will be turned on.
Wrong. At -O0 options that would _increase_ compilation time are _not_
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 don't know what this means.
> I give an example: This option is enabled at O0 level
>
> -faggressive-loop-optimizations
No it isn't.
> 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.
Wrong.
> Can someone confirm that?
No, because you're wrong, as Andrew has said twice.