From patchwork Wed Feb 3 17:51:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1435516 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=B4hBxLVj; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DW8Pd2msKz9tlJ for ; Thu, 4 Feb 2021 04:51:31 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 153DF388E81E; Wed, 3 Feb 2021 17:51:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 153DF388E81E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1612374689; bh=QWdTEV3R2mA3EJU5Yxy61/f4Ch3v8Ub/N3O/r1gtvjA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=B4hBxLVjM6DzW5URdkIXJVyGO66CT45VyvFOk+pHvYC82T2/2+fxzsUCrPvF4tWux 5jIuTUTnEWKBcadFy44xzofyPrVfgEQqRzHjIe6StbTcFYD3TTPA/w5pXyJLyO26I2 uHHCZaA5HPDVih0F1GFbFWJsCvENWD4nVcj2ZY30= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 1F24F384B009 for ; Wed, 3 Feb 2021 17:51:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1F24F384B009 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-582-tYjkti3pMeSogQWeL9t6Pg-1; Wed, 03 Feb 2021 12:51:25 -0500 X-MC-Unique: tYjkti3pMeSogQWeL9t6Pg-1 Received: by mail-qt1-f198.google.com with SMTP id t5so519609qti.5 for ; Wed, 03 Feb 2021 09:51:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QWdTEV3R2mA3EJU5Yxy61/f4Ch3v8Ub/N3O/r1gtvjA=; b=AtBS8n0hG+utL+gOOqiChjLueEKMUYvVZk1Z3qVco+Ax8XZqqRlEmJ5n0E5F2GtGQQ UhdVBKIt8dtcDfNx0MR46SOyppcgXlJIoIVEms/nrCoXDHhiRByKgWoJoVEPrLcyt7/G qYbmrufEQoTo+MuxoCtuzccoXOi+xbzg4Mo7VKz8rgtyu13XS8OQmMOudCR2xDEEtT0c THvkqfgfEoZd850GIhP8l/+eZWcLNjidyCYMItYX5DVQXCt3y/sIIMOTRpOBizLp90X6 tscoyCSwGfVSuICQNw9FVMCyq8cthI0X9of3ac0IV8qq7/YTw6cMDtTGM+uE4eQa+AKO uYVA== X-Gm-Message-State: AOAM533mWOmhQR9xjvARpvg+b/OVqpgkKY991gAVlFHNzXHn/b4l1GRD CLdpfo3mgTFPWNjistdkKaRaMqTKCiOjxr2yXeU2jYOaxmjV/s872rSEo4Udm+5oOp+B6f/CJBD 0+Dq8Su+WeKF1rYvUyBfzMwwMmjsu6PszrGoM/uh6Qu/Mbd/w9TLPEAJB4TEyOEfQ+w== X-Received: by 2002:a05:620a:13e2:: with SMTP id h2mr3685382qkl.495.1612374684346; Wed, 03 Feb 2021 09:51:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIQNd8HTEisNTzBA3ds6mTAqczEvRDbD4k12fFfW+1eKTFRnFpwWWTUP5FS75mvmMbupC2oA== X-Received: by 2002:a05:620a:13e2:: with SMTP id h2mr3685340qkl.495.1612374683780; Wed, 03 Feb 2021 09:51:23 -0800 (PST) Received: from barrymore.redhat.com (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id b72sm2224148qkc.60.2021.02.03.09.51.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 09:51:22 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: Fix alias comparison [PR98926] Date: Wed, 3 Feb 2021 12:51:21 -0500 Message-Id: <20210203175121.1992383-1-jason@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-16.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jason Merrill via Gcc-patches From: Jason Merrill Reply-To: Jason Merrill Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" The comparison of dependent aliases wasn't working here because processing_template_decl wasn't set, so dependent_alias_template_spec_p was always returning false. Tested x86_64-pc-linux-gnu (with the strict-gc parms below), applying to trunk. gcc/cp/ChangeLog: PR c++/98926 PR c++/98570 * pt.c (spec_hasher::equal): Set processing_template_decl. * Make-lang.in (check-g++-strict-gc): Add --param hash-table-verification-limit=10000. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/alias-decl-dr1558.C: Pass --param hash-table-verification-limit=10000. --- gcc/cp/pt.c | 2 ++ gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1558.C | 1 + gcc/cp/Make-lang.in | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) base-commit: 5c3d388aee5609d32bd8e3ba1add776b1a6f0d1f diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4781519d00f..c5b0a9292db 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1720,6 +1720,7 @@ spec_hasher::equal (spec_entry *e1, spec_entry *e2) ++comparing_specializations; ++comparing_dependent_aliases; + ++processing_template_decl; equal = (e1->tmpl == e2->tmpl && comp_template_args (e1->args, e2->args)); if (equal && flag_concepts @@ -1734,6 +1735,7 @@ spec_hasher::equal (spec_entry *e1, spec_entry *e2) tree c2 = e2->spec ? get_constraints (e2->spec) : NULL_TREE; equal = equivalent_constraints (c1, c2); } + --processing_template_decl; --comparing_dependent_aliases; --comparing_specializations; diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1558.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1558.C index 2bbb138ec22..8495462bd6d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1558.C +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1558.C @@ -1,5 +1,6 @@ // DR 1558 still applies when using void_t as a template-argument. // { dg-do compile { target c++11 } } +// { dg-additional-options "--param hash-table-verification-limit=10000" } template using void_t = void; template struct A { }; diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 62295fb0dfe..155be74efdb 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -224,7 +224,7 @@ check-c++-all: # Run the testsuite with garbage collection at every opportunity. check-g++-strict-gc: - $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --extra_opts,--param,ggc-min-heapsize=0,--param,ggc-min-expand=0" \ + $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --extra_opts,--param,ggc-min-heapsize=0,--param,ggc-min-expand=0,--param,hash-table-verification-limit=10000" \ TESTSUITEDIR="$(TESTSUITEDIR).gc" check-g++ check-c++-subtargets : check-g++-subtargets # List of targets that can use the generic check- rule and its // variant.