From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43362 invoked by alias); 11 May 2018 13:09:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 43347 invoked by uid 89); 11 May 2018 13:09:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=our X-HELO: smtp.ispras.ru Received: from bran.ispras.ru (HELO smtp.ispras.ru) (83.149.199.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 May 2018 13:09:35 +0000 Received: from monopod.intra.ispras.ru (monopod.intra.ispras.ru [10.10.3.121]) by smtp.ispras.ru (Postfix) with ESMTP id E385E203CD; Fri, 11 May 2018 16:09:32 +0300 (MSK) Date: Fri, 11 May 2018 13:12:00 -0000 From: Alexander Monakov To: Richard Biener cc: GCC Patches Subject: Re: [PATCH 1/2] gcc_qsort: source code changes In-Reply-To: Message-ID: References: <20180510155641.2950-1-amonakov@ispras.ru> <20180510155641.2950-2-amonakov@ispras.ru> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2018-05/txt/msg00559.txt.bz2 On Fri, 11 May 2018, Richard Biener wrote: > Looks good to me. As additional enhancement we might want to provide > (even unconditionally?) > the glibc qsort_r() interface. I remember adding various globals to > pass down state to the comparator... Thanks. I have no plans w.r.t qsort_r, but OTOH a stable sort interface can be added with tiny size/speed cost, and the sole in-tree use can be converted :) > I agree self-tests might be good to have. Also it looks like the > qsort-checking may now be somehow > embedded within our qsort implementation? I gave self-tests some thought after David's mail, and honestly I don't see much value in that, given that we run qsort_chk on everything. As for embedding, I don't think that's necessary. I prefer to keep them separate. Alexander