http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45948

--- Comment #4 from Sebastian Pop <spop at gcc dot gnu.org> 2010-12-02 18:39:23 
UTC ---
For this case, we end up generating two memset (0) for the first loop,
and we completely remove that loop:

void
foo (int i, int n)
{
  int a[30];
  int b[30];
  for (; i < n; i++)
    a[i] = b[i] = 0;

  while (1)
    if (b[0])
      bar (a[i - 1]);
}

The problem seems to be that the close phi node for the last value of
i is not removed by the scev constant propagation, and we don't have
the for loop anymore to compute it.

Reply via email to