https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101793
Jeffrey A. Law <law at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at gcc dot gnu.org --- Comment #8 from Jeffrey A. Law <law at gcc dot gnu.org> --- I'm pretty sure this is a case where -O1 throttles jump threading. Jump threading is critical to avoiding the false positive warning in this testcase. At -O2 the first full jump threading pass cleanings things up enough that the false positive will ultimately be avoided. In general, you'll find that -O2 will be much more precise for these kinds of warnings. So, yes, this is a bug. But it's not likely to get fixed anytime soon.