https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59970
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org Summary|Bogus warnings at low |Bogus Wuninitialized |optimization levels |warnings at low | |optimization levels --- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Thomas Schwinge from comment #0) > It does seem appropriate to me for GCC not to do such tracking at low > optimization levels, but then the uninitialized warning should also be > disabled (which I assume is happening for -O0?) to avoid false positive > warnings. It doesn't work like that. The uninit pass sees the code as transformed by other optimization passes, thus what the uninit pass sees depends not on a particular level but on the passes enabled, their order and their effect on the given code. Higher levels do not always mean better uninit warnings, either. Nonetheless, it would be useful to identify which passes do more good than harm for uninit (probably VRP) and enable those at lower levels somehow or even in some limited form in the FEs.