Noted with thanks. Krishna Narayanan On Wed, Feb 9, 2022 at 10:31 PM Segher Boessenkool < segher@xxxxxxxxxxxxxxxxxxx> wrote: > On Tue, Feb 08, 2022 at 05:37:12PM +0000, Jonathan Wakely via Gcc-help > wrote: > > It warns with -O1, which is the documented behaviour: > > > > The effectiveness of some warnings depends on optimizations also > > being enabled. For example -Wsuggest-final-types is more > > effective with link-time optimization and -Wmaybe-uninitialized > does > > not warn at all unless optimization is enabled. > > > > So no, I don't think it' a bug. GCC is behaving as designed. Ideally it > > would be better at warning without optimization, but changing that would > be > > hard. > > GCC does not execute most of its code at -O0. This is important for > speed of course, but much more importantly it also allows us to use -O0 > when other optimisation levels crash or generate wrong code. This is > useful for the compiler developers of course, but it also is an > important workaround for users, when bad things happen. > > > Segher >