On 29/04/2021 14:42, Jan Beulich wrote: > On 29.04.2021 15:22, Costin Lupu wrote: >> On 4/29/21 3:40 PM, Jan Beulich wrote: >>> If there is a specific case where the compiler fails to DCE the >>> offending code, then you need to describe this in sufficient >>> detail. >> Yes, indeed. My bad, it is for a debug build with -O0, so without DCE. > Iirc there's a series pending to switch to -Og; I don't think we > build with -O0 under any circumstances (for this very reason).
-Og is roughly about -O0.9. There is certainly some trivial DCE involved, but no optimisations which radically rearrange the code structure. The -Og series did survive some randconfig testing, but I can't guarantee that it was comprehensive. As for -O0, I think causality is the other way around there. Wei elected to rely on DCE for conditional compilation because we didn't seem to care about compiling at -O0. Part of me thinks that we ought to cope compiling at any optimisation level, including -O0, but I doubt I'd like the extra ifdef-ary required to make that work. I think we absolutely should have Kconfig to select between -Og/1/2/3, as well as binutils new microarch levels ~Andrew