1

I have been searching about that all over the web. The only thing i found is people saying that it, in fact, does some optimization, but they dont specify which one.

Thanks

  • https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html – Iłya Bursov May 08 '22 at 00:25
  • Checking this documentation, there are some optimizations enabled by default in -O0: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html – Victor May 08 '22 at 00:25
  • @Victor Where do you see that "some optimizations are enabled by default in -O0" ? I see nothing about that in the doc (though it does not say that all optimizations are disabled but just "most"). If if so which one would be enabled? – Jérôme Richard May 08 '22 at 00:42
  • 1
    Related: [Disable all optimization options in GCC](https://stackoverflow.com/q/33278757) / [How to turn off all optimizations in GCC](//stackoverflow.com/q/20248424) - GCC does [Why does GCC use multiplication by a strange number in implementing integer division?](//stackoverflow.com/q/41183935) at `-O0` along with some other stuff inside an expression, although it doesn't do constant-propagation between statements so it only applies for stuff like `x/10` or for `const` variables. See [Why does integer division by -1 (negative one) result in FPE?](https://stackoverflow.com/q/46378104) – Peter Cordes May 08 '22 at 05:07

0 Answers0