From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1888) id A92F43858D32; Sat, 3 Jun 2023 13:27:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A92F43858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685798839; bh=f5sanC8SZB8N4xqVo+nnXX9HFq71E8QhhByf049auVQ=; h=From:To:Subject:Date:From; b=ACv/86MkNtus8vmFgYqh1Y6viyq/FiaZkfxZSEfuU0EKkZ0zJ8/MHB+PbDw+vHdxj RDDpzDJK8D4SOe/+PghzpH7LwJPBo0AQVWa1qAMCLi+sA+hncJlOG4HsH7fdK8Of6n 8GkVs6sOWPqOqAxIDD9y+2DptRZav2ZuV5FsWi0E= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Patrick Palka To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1518] c++: simplify TEMPLATE_TEMPLATE_PARM hashing X-Act-Checkin: gcc X-Git-Author: Patrick Palka X-Git-Refname: refs/heads/master X-Git-Oldrev: 557cc2b721432775a12fcafa60e9b8b0c320c29d X-Git-Newrev: 23bee8508816297a9b2ab81a96aa0c79ac88ceba Message-Id: <20230603132719.A92F43858D32@sourceware.org> Date: Sat, 3 Jun 2023 13:27:19 +0000 (GMT) List-Id: https://gcc.gnu.org/g:23bee8508816297a9b2ab81a96aa0c79ac88ceba commit r14-1518-g23bee8508816297a9b2ab81a96aa0c79ac88ceba Author: Patrick Palka Date: Sat Jun 3 09:22:52 2023 -0400 c++: simplify TEMPLATE_TEMPLATE_PARM hashing r10-7815-gaa576f2a860c82 added special hashing for TEMPLATE_TEMPLATE_PARM to work around non-lowered ttps having TYPE_CANONICAL set but lowered ttps did not. But ever since r13-737-gd0ef9e06197d14 this is no longer the case, and all ttps should now have TYPE_CANONICAL set. So this special hashing is now unnecessary and we can fall back to always using TYPE_CANONICAL. gcc/cp/ChangeLog: * pt.cc (iterative_hash_template_arg): Don't hash TEMPLATE_TEMPLATE_PARM specially. Diff: --- gcc/cp/pt.cc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 244b0b03454..dae3815f62a 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -1879,19 +1879,8 @@ iterative_hash_template_arg (tree arg, hashval_t val) return hash_tmpl_and_args (TI_TEMPLATE (ti), TI_ARGS (ti)); } - switch (TREE_CODE (arg)) + switch (code) { - case TEMPLATE_TEMPLATE_PARM: - { - tree tpi = TEMPLATE_TYPE_PARM_INDEX (arg); - - /* Do not recurse with TPI directly, as that is unbounded - recursion. */ - val = iterative_hash_object (TEMPLATE_PARM_LEVEL (tpi), val); - val = iterative_hash_object (TEMPLATE_PARM_IDX (tpi), val); - } - break; - case DECLTYPE_TYPE: val = iterative_hash_template_arg (DECLTYPE_TYPE_EXPR (arg), val); break;