From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 237AD385DC13; Sat, 18 Apr 2020 10:55:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 237AD385DC13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587207359; bh=f3OoG7w3kMqWlRrTfwjJu6slEHmUx/t1Kd9UEhzYU8E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OOnSYfbKspieNTXLJY+tYhAwlYxbRFsletGrcuHso+UqjxjqOI98A76DoiROKmLJh 6V6tcMeItZEgwhcKh/rkWOOfqZmjyerYoCvvyM5j4QnG8pv7ENcE5pBYpEemYYUvE0 F/Gnuo1T9jFoUYP2KoKKa34gZccC6Ekd/zVEymo8= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94632] [10 Regression] canonical types differ for identical types since r10-7622-g12f55e030ed068d5 Date: Sat, 18 Apr 2020 10:55:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2020 10:55:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94632 --- Comment #3 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:f83adb68ed9cef1fbd4c16447eb4e89676df9f62 commit r10-7787-gf83adb68ed9cef1fbd4c16447eb4e89676df9f62 Author: Patrick Palka Date: Sat Apr 18 06:22:21 2020 -0400 c++: spec_hasher::equal and PARM_DECLs [PR94632] In the testcase below, during specialization of c::d, we build two identical specializations of the parameter type b -- one when substituting into c::d's TYPE_ARG_TYPES and another when substitut= ing into c::d's DECL_ARGUMENTS. We don't reuse the first specialization the second time around as a consequence of the fix for PR c++/56247 which made PARM_DECLs always compare differ= ent from one another during spec_hasher::equal. As a result, when looking up existing specializations of 'b', spec_hasher::equal considers the template argum= ent decltype(e')::k to be different from decltype(e'')::k, where e' and e''= are the result of two calls to tsubst_copy on the PARM_DECL e. Since the two specializations are considered different due to the menti= oned fix, their TYPE_CANONICAL points to themselves even though they are otherwise identical types, and this triggers an ICE in maybe_rebuild_function_decl_type when comparing the TYPE_ARG_TYPES of c::d to its DECL_ARGUMENTS. This patch fixes this issue at the spec_hasher::equal level by ignoring= the 'comparing_specializations' flag in cp_tree_equal whenever the DECL_CONTEXTs of the two parameters are identical. This seems to be a sufficient condit= ion to be able to correctly compare PARM_DECLs structurally. (This also subsumes= the CONSTRAINT_VAR_P check since constraint variables all have empty, and therefore identical, DECL_CONTEXTs.) gcc/cp/ChangeLog: PR c++/94632 * tree.c (cp_tree_equal) : Ignore comparing_specializations if the parameters' contexts are identical. gcc/testsuite/ChangeLog: PR c++/94632 * g++.dg/template/canon-type-14.C: New test.=