On Mon, Oct 16, 2017 at 4:53 PM, Bin Cheng <bin.ch...@arm.com> wrote: > Hi, > I was asked by Richi to replace insertion sort with qsort_range in loop > nest distribution patch. Although I believe stable sort (thus insertion) > sort is needed in that case, I also added qsort_range interface in vec.h. > The new interface might be useful in other places. > Bootstrap and test on x86_64 and AArch64 with other patches. Is it OK?
I think you want gcc_checking_assert (e >= s && e < length ()); if (e - s + 1 > 1) ::qsort (...); so elide qsort for 1 element and do the validity verification with a checking assert. Ok with that change. Richard. > Thanks, > bin > 2017-10-13 Bin Cheng <bin.ch...@arm.com> > > * vec.h (struct GTY((user)) vec<T, A, vl_embed>::qsort_range): New > member function. > (struct vec<T, va_heap, vl_ptr>): New member function.