From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128997 invoked by alias); 31 Jul 2017 18:06:46 -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 128709 invoked by uid 89); 31 Jul 2017 18:06:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1290, accompanying X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 31 Jul 2017 18:06:40 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9AD9DA14EC; Mon, 31 Jul 2017 18:06:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9AD9DA14EC Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law@redhat.com Received: from localhost.localdomain (ovpn-116-95.phx2.redhat.com [10.3.116.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id 687D760606; Mon, 31 Jul 2017 18:06:39 +0000 (UTC) Subject: Re: [PATCH 6/6] qsort comparator consistency checking To: Alexander Monakov , gcc-patches@gcc.gnu.org References: <20170715204749.24398-1-amonakov@ispras.ru> <20170715204749.24398-7-amonakov@ispras.ru> From: Jeff Law Message-ID: Date: Mon, 31 Jul 2017 18:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170715204749.24398-7-amonakov@ispras.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg02062.txt.bz2 On 07/15/2017 02:47 PM, Alexander Monakov wrote: > This is the updated qsort comparator verifier. > > Since we have vec::qsort(cmp), the patch uses the macro argument counting > trick to redirect only the four-argument invocations of qsort to qsort_chk. > I realize that won't win much sympathies, but a patch doing mass-renaming > of qsort in the whole GCC codebase would win even fewer, I suspect. > > The macro ENABLE_FULL_QSORT_CHECKING could be used to enable full O(n^2) > checking, but there's no accompanying configure.ac change. I'm not sure > that would be useful in practice, so I'd rather turn it into #if 0. > > The suppression in genmodes was needed because it's not linked with vec.o. > > * genmodes.c (calc_wider_mode): Suppress qsort macro. > * system.h [CHECKING_P] (qsort): Redirect to qsort_chk. > (qsort_nochk): New macro. > (qsort_chk): Declare. > (qsort_disable_checking): Declare. > * vec.c (qsort_chk_error): New static function. > (qsort_disable_checking): Define. > (qsort_chk): New function. I must have missed something. Can't you just define qsort (BASE, NMEMB, SIZE, COMPARE) into qsort_chk (BASE, NMEMB, SIZE, COMPARE) That shouldn't affect the qsort from vec? Right? Or am I missing something Jeff