https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562
--- Comment #18 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Sven Hesse from comment #17) > I still get this with gcc 12.2.0 (Gentoo 12.2.0 p9), but only when compiling > with (at least with) -O1 -fsanitize=address, in addition to any warning flag > that enables -Wmaybe-uninitialized (like -Wall, -Wextra or -Wuninitialized). > > -O0 and/or no ASan, and the offending code compiles cleanly without any > warnings. Somehow, the combination of enabling ASan and optimization > (anything > -O0, but not -Os) triggers it again, it seems? > > I can observe this with the testcase attached here in this bug report. -fsanitize=address is likely to derail optimization enough to make such occurences more likely, I think we have plenty of duplicate bugreports for this.