https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121280
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note this code is undefined if vect.empty() is true due to front being undefined in that case. Adding that check makes the warning go away too; either for `vect_copy.empty()`or `vect.empty()`. So this is definitely NOT a false positive (there is a missed optimization with respect size()==0 case but that is fixed up later on). Also see https://gcc.gnu.org/pipermail/gcc-patches/2025-August/691467.html .