Extended doubt regarding the bug 93432
Segher Boessenkool
segher@kernel.crashing.org
Wed Feb 9 16:59:21 GMT 2022
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
More information about the Gcc-help
mailing list