This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH GCC]Introduce qsort_range interface for GCC vector
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bin Cheng <Bin dot Cheng at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Tue, 17 Oct 2017 15:00:16 +0200
- Subject: Re: [PATCH GCC]Introduce qsort_range interface for GCC vector
- Authentication-results: sourceware.org; auth=none
- References: <DB5PR0801MB27427080EF52F920D24BF223E74F0@DB5PR0801MB2742.eurprd08.prod.outlook.com>
On Mon, Oct 16, 2017 at 4:53 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> 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)
so elide qsort for 1 element and do the validity verification with a
Ok with that change.
> 2017-10-13 Bin Cheng <firstname.lastname@example.org>
> * 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.