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

--- Comment #9 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-11-15 
01:01:30 UTC ---
This is reduced testcase from gcov.c
int a[8];
int
t (void)
{
  int ix = 0;
  int k;
  int b = 0;
  int curr = 0;
  for (k = 0; k < 2; k++)
    {
      b = ix * 32;
      curr = a[ix++];
      if (!(ix <= 8))
        abort ();

      while (curr)
        {
          b = ix * 32;
          curr = a[ix++];
          if (!(ix <= 8))
            abort ();
        }
    }
  return curr + b;
}

jan@linux-e0ml:~/trunk/build/gcc> ./xgcc -B ./ -O2 -fprofile-use t.c
-Warray-bounds -S -S -fdump-tree-cunroll-details  -fdump-tree-all-details  
t.c: In function ‘t’:
t.c:14:2: warning: incompatible implicit declaration of built-in function
‘abort’ [enabled by default]
  abort ();
  ^
t.c:25:1: note: file /home/jan/trunk/build/gcc/t.gcda not found, execution
counts estimated
 }
 ^
t.c:19:15: warning: array subscript is above array bounds [-Warray-bounds]
       curr = a[ix++];
               ^
t.c:19:15: warning: array subscript is above array bounds [-Warray-bounds]

Obivously here unroller does not know that bv_ix is at least 1

Reply via email to