On 05/26/2012 01:27 AM, Ramana Radhakrishnan wrote:
- for (i = 0; i< nelt; i += diff)
+ for (i = 0; i< nelt ; i += (diff + 1))
for (j = 0; j<= diff; j += 1)
- if (d->perm[i + j] != i + diff - j)
- return false;
+ {
+ /* This is guaranteed to be true as the value of diff
+ is 7, 3, 1 and we should have enough elements in the
+ queue to generate this. Getting a vector mask with a
+ value of diff other than these values implies that
+ something is wrong by the time we get here. */
+ gcc_assert ((i + j)< nelt);
Yep, that all looks correct. Unnecessary () in both lines though.
r~