From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 26C243857026; Fri, 23 Dec 2022 00:58:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26C243857026 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671757099; bh=6RwmBGmvi9WxlUpiBJz3WhxVpnZJVDzwIF+6P25iP8I=; h=From:To:Subject:Date:From; b=ZrQ/SxRyMDt2/602cbgCNXgfAE4CwszKVhSGqyW0lqYe+UBfVfkFfJ5h9Jq5Cl0UV ++5WgYJFcpi77IYn6/HOQ94paRWJU6erYCKaUlbyiz2m5c/fqeqbeU44l3kKW7RiOh hAdl7fQRnr68zxOBIaZ6Hsn6RVVa7b5KxHyEBQQw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] [C++] constraint: insert norm entry once X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: c970ba27da4df7f21b90318eb2b8fd510051119e X-Git-Newrev: ff6ccdebd02c42840a19922ec5a3accab8b62d84 Message-Id: <20221223005819.26C243857026@sourceware.org> Date: Fri, 23 Dec 2022 00:58:19 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ff6ccdebd02c42840a19922ec5a3accab8b62d84 commit ff6ccdebd02c42840a19922ec5a3accab8b62d84 Author: Alexandre Oliva Date: Thu Dec 22 21:28:51 2022 -0300 [C++] constraint: insert norm entry once Diff: --- gcc/cp/constraint.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index 37eae03afdb..f28f96ada46 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -777,14 +777,16 @@ normalize_concept_check (tree check, tree args, norm_info info) norm_entry entry = {tmpl, targs, NULL_TREE}; norm_entry **slot = nullptr; hashval_t hash = 0; + bool insert = false; if (!info.generate_diagnostics ()) { /* Cache the normal form of the substituted concept-id (when not diagnosing). */ hash = norm_hasher::hash (&entry); - slot = norm_cache->find_slot_with_hash (&entry, hash, INSERT); - if (*slot) + slot = norm_cache->find_slot_with_hash (&entry, hash, NO_INSERT); + if (slot) return (*slot)->norm; + insert = true; } /* The concept may have been ill-formed. */ @@ -794,7 +796,7 @@ normalize_concept_check (tree check, tree args, norm_info info) info.update_context (check, args); tree norm = normalize_expression (def, targs, info); - if (slot) + if (insert) { /* Recompute SLOT since norm_cache may have been expanded during the recursive call. */