From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 63105385B52D for ; Fri, 27 Oct 2023 22:05:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 63105385B52D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 63105385B52D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698444305; cv=none; b=S/dglaUXvq4PitrFWKDxQxW81ZOdesgI1jvt8ZwMzyp9Zmyy0Zs2tAamROp0WFRn+AYZIDyuScp2WCehBqpfkrUJ6StdMiD/N6XWfD2jDPdWBL0clGlc/Kz7hf/GM4poPkq+T2Zu7KvBllEXgvTlf/lHG/1tujHaloUUaeB+nHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698444305; c=relaxed/simple; bh=ciwsHOYxDNJf7vBsPxrdYxGZ1DEOMvYtpD3bgvCHoXk=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=SMmVSaiiaa3ocsXi1EAmRrFzBOXH00dYE8kIR+6VO7ImFY2mqUOWNq2doorlFrNqbluXLwTDwgqwl7Fe14XR0EG0UvTnogKmRG95rEX/Ikq1GQFUxta2sbWGow/XXETCOBM6fIBA5HLcsgCuiPPRMHnXzaoRrNdWvoHu91K+PtU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698444304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bvQBw8yD6mbhnzYBPH/pnrjkE7+Hf+gQQ3FbJcWVHlY=; b=U/zL1mNDJ3VRnCUWBn2ctD1GW7uitcxb09AfpodMq3DrHl41BTTbBbaqSQA6O2Dd+7OmgD 6K2yFXObd5xGOrDMFX1Qhx51zBWVSYu2JxFzH+DyGBTjyQ85GFvT3JzqLZV50bJPX+cUv0 CKt4e5AhHqnqGEooQnaX+/MBJWuw8FA= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-fhiCmjd0O3qGghg0j9rrNw-1; Fri, 27 Oct 2023 18:05:02 -0400 X-MC-Unique: fhiCmjd0O3qGghg0j9rrNw-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-66d159f725cso33544016d6.2 for ; Fri, 27 Oct 2023 15:05:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698444302; x=1699049102; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bvQBw8yD6mbhnzYBPH/pnrjkE7+Hf+gQQ3FbJcWVHlY=; b=B1DPUA9ppweZjMzxMilrmJTpuT0n6krgnR3I3EN4BhqkenmKRR02NH3+zdeA5DBN46 QEFXR/AAai4W3GumAxzAN0VgkS/WXsimQbUnxfPh3lYWWUyqXKME4prx3KntKmTOR07j Mx7BUioxHO+8j8DL47cQDbi12g3itk2s4BugoKMx1UvLtg8ujqAaZkBMFpXa26jmkVvh QFZNOSK1XGfisjf4bOw04IJrnpP7fIPbnODb5OGE6cDOXV3EQpWmhTePu3arW8SEUufS gGqOR9kvkYdRYeTGzUgSiV5FsFhDoy6w2dtX9HBV7dGa0UsbYfFeDMGKSDWrRvwSBz9C uh1w== X-Gm-Message-State: AOJu0Yy1mtYzoTWeKuoAmtmSJmkl0FOsTQiv9XxPhrGKRBSWwPo4VII5 DIUZzKKYYJt37FLx2YPSTXo3y59pIeQTxUgRF/ZTPocArD7meN7NbdISsFpFAMQAyVjJrplvbZn wUdGPTbTTaSmTp4jHJw== X-Received: by 2002:a05:6214:1c46:b0:66d:5ea8:a7ba with SMTP id if6-20020a0562141c4600b0066d5ea8a7bamr6257620qvb.1.1698444302015; Fri, 27 Oct 2023 15:05:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcgt3mYIMeVtH/66+jWaKHnghaUyqzacdkk6FAh+aajB8utjyGOz/yKCN3fr5w2ZBmbX/3cw== X-Received: by 2002:a05:6214:1c46:b0:66d:5ea8:a7ba with SMTP id if6-20020a0562141c4600b0066d5ea8a7bamr6257596qvb.1.1698444301699; Fri, 27 Oct 2023 15:05:01 -0700 (PDT) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id w7-20020a05620a094700b007742c6823a3sm934720qkw.108.2023.10.27.15.05.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Oct 2023 15:05:01 -0700 (PDT) Message-ID: <8e117f80-49da-44d7-828b-9e22df879cb4@redhat.com> Date: Fri, 27 Oct 2023 18:05:00 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/3] c++: sort candidates according to viability To: Patrick Palka , gcc-patches@gcc.gnu.org References: <20231027195532.2566822-1-ppalka@redhat.com> From: Jason Merrill In-Reply-To: <20231027195532.2566822-1-ppalka@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10/27/23 15:55, Patrick Palka wrote: > New in patch 1/3: > * consistently use "non-viable" instead of "unviable" > throughout > * make 'champ' and 'challenger' in 'tourney' be z_candidate** > to simplify moving 'champ' to the front of the list. drive-by > cleanups in tourney, including renaming 'champ_compared_to_predecessor' > to 'previous_worse_champ' for clarity. > New in patch 2/3: > * consistently use "non-viable" instead of "unviable" throughout > New in patch 3/3: > * introduce new -fnote-all-cands flag that controls noting other > candidates when diagnosing deletedness, and also controls > noting "ignored" candidates in general. > > -- >8 -- > > This patch: > > * changes splice_viable to move the non-viable candidates to the end > of the list instead of removing them outright > * makes tourney move the best candidate to the front of the candidate > list > * adjusts print_z_candidates to preserve our behavior of printing only > viable candidates when diagnosing ambiguity > * adds a parameter to print_z_candidates to control this default behavior > (the follow-up patch will want to print all candidates when diagnosing > deletedness) > > Thus after this patch we have access to the entire candidate list through > the best viable candidate. > > This change also happens to fix diagnostics for the below testcase where > we currently neglect to note the third candidate, since the presence of > the two unordered non-strictly viable candidates causes splice_viable to > prematurely get rid of the non-viable third candidate. > > gcc/cp/ChangeLog: > > * call.cc: Include "tristate.h". > (splice_viable): Sort the candidate list according to viability. > Don't remove non-viable candidates from the list. > (print_z_candidates): Add defaulted only_viable_p parameter. > By default only print non-viable candidates if there is no > viable candidate. > (tourney): Make 'candidates' parameter a reference. Why, when all the callers use the return value? OK without that change. Jason