https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120135
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The warning is correct. SRA makes some odd decisions which causes the diagnostic to sometimes show up and sometimes does not show up.