2 ms·
Despite the fact that you say "all the major compilers", GCC and Clang make very different decisions for each optimization level. In particular, GCC generates
by o11c 3y ago
Despite the fact that you say "all the major compilers", GCC and Clang make very different decisions for each optimization level.
In particular, GCC generates fairly debuggable code at all optimization levels, so there is less motivation for -O0 in the first place.
- MaskRay 3y agoThere is ongoing work to improve debuggability for optimized code. https://discourse.llvm.org/t/rfc-redefine-og-o1-and-add-a-new-level-of-og/72850 https://discourse.llvm.org/t/rfc-redefine-og-o1-and-add-a-ne... ``` Mode | Execution Time | Debuggability | Compile Time O0 | 1.0000 | 1.0000 | 1.0000 Og | 0.3439 | 0.5357 | 1.8630 O1 | 0.3082 | 0.4241 | 1.7880 O2g | 0.2823 | 0.4845 | 3.0420 O2 | 0.2514 | 0.3908 | 2.9380 ```