https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99707
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The front end does not normally do constant prop if the variable is not a const/constexpr so the warning would be done in the middle end and might have false warnings so it might not be useful.