https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109440
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |alias
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There are a few things, the most obvious thing is the middle-end thinks the
content of v can change via the call to foo.
If you make a local copy, then there is a missing VRP which can be fixed by
changing the type of i to size_t.