https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118865
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note the reduced testcase is actually NOT a false positive, it shows up because of jump threading; PR109071 recordes the diagnostic issue there. As I mentioned in comment #1 . comment #4 better explains what is going on and why it shows up since GCC 11. Comment #5 has a patch which improves code gen due to not having enough information on the loads and such.