https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108565
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |fixed-but-no-testcase,
| |needs-bisection
Known to fail| |12.5.0
Known to work| |13.1.0
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So the diagnostic was fixed in GCC 13.1.0.
The missed optimization is fixed in GCC 15 though and foo is empty now after
optimizations.