https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127510
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
So this is an exit condition like
void foo (int *x, int sn, int sm, int n, int m)
{
int i = sn;
int j = sm;
if (n != 0 || m != 0)
do
{
x[i++] = 1;
j++;
}
while ((i != n) & (i != m));
}
so there are N IVs that need to arrive at their exit value at the same
time for the loop to terminate. This might or might not be something
to optimize separately - that is, rewrite in IVCANON (which requires
niter to be computable...). Rewrite { a, +, CST }, { b, +, CST }
with same CST to { 0, +, CST } and replace uses by init + IV and then
version the loop on the condition it can terminate? That is, the
exit condition is quite unfortunate - is this somehow controlled by
libstdc++ and can we fix it there?