From patchwork Wed May 1 09:58:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathaniel Shead X-Patchwork-Id: 1930111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=go1+NfPV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VTswh4PqXz1ymp for ; Wed, 1 May 2024 19:59:14 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EAD1B3858428 for ; Wed, 1 May 2024 09:59:12 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 974EC3858D34 for ; Wed, 1 May 2024 09:58:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 974EC3858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 974EC3858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714557531; cv=none; b=a0q9Mq7Q7kgGdjM0tQgKLFVJv1rVX+la2cDdHYxPu1v7DeeLL6jzmM1qWAuqCsRGR0KJJz+nHTsIvkgf+tBUrQZoW+B0wjIFKPjSLmrQChbLgQSxNC0NWr/5LLzCMMZum+rXvaDatEUG9SV9Q3LzToct3NFa8Rpt+Dg64RyvYCc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714557531; c=relaxed/simple; bh=hqtcSPI11xd7jnB7sPKRuD1Jk/lfT0CM7s5P+ncG8KE=; h=DKIM-Signature:Message-ID:Date:From:To:Subject:MIME-Version; b=j0NGSmohM6o7romJ6h3hcLdfhKf3IN/PS1FcEvlKAcIa3GXxFfXI8kLsYKjVzvvDnHK1Kj2jYgPCeeR80c6jxh1m1jmD7ok/IU6WLggH1i9NXRczGHtimNnzQBKo9eUp0zVi5Meyk3yXInD6xf2NUvRU8K61MGDLpLdEpCFfwww= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1eab699fcddso52061345ad.0 for ; Wed, 01 May 2024 02:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714557528; x=1715162328; darn=gcc.gnu.org; h=content-disposition:mime-version:subject:cc:to:from:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Ob7mmQlnyLLXBs92vRjizwLUQ8XM09TTC+iZn1WTDjI=; b=go1+NfPV0bGEjlEmEEOKoRd0MXcAFtHWfnmA6Mpv7WohvFgsVW/eXXJkyHhchwrJW/ lqdkHblcvVMTyXeAAGHaOma15fptBmDLz+3rGDUVveINwJou+VrjS3geHgW75B9/SU9j ttgqniVtfqLjfgfF9sS33vJCBJHP2I0JhcdAsM1MEKeDouspki65Oz9mxgevSIjBLCXr +qSC8zLLK1lRhDBAhnGIqAr+SVtTvPxoWi9sTSHNQe0DLfmQ2E7UL+W0SS5oEDuMU5Tv jmJc7xwyWowyIBox+gXMFvQPC6Nrla0pIvcq3/fYGm9d6x/E17PjcyEvUQfPe58f6Lb9 w1uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714557528; x=1715162328; h=content-disposition:mime-version:subject:cc:to:from:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ob7mmQlnyLLXBs92vRjizwLUQ8XM09TTC+iZn1WTDjI=; b=H7GxxHRnjl6bBSWesDUAyys7soziZhZygEe7fwnKWPC9h2SVTCWRXFXEBoZC8BoQ3w 9XVBbxS3FdKa6wN0xyLXEv7SL+B45BbjjROmuZ4AlWwVLr0OgwLuCMBXu/jwvCRfu+UA ypY5+lcRD8YoWG9uqVYQrkXvk9CTuMtNW5mfydTKL+ZKO7tPfRu8KbOMGmzPZl/BEYhc HkSUKxPPNX1mkb4cSypIGCPmKQm2RMxtKKW1nHL6dlPBf94b2uor+u+9lLSLTP0QRLjk IXtxnKsbbvb12oiAkGpBtioZ6lDb2/aYlZEgUcttH4a4CpQtq339vITerTt7k4ovQF0L kBrg== X-Gm-Message-State: AOJu0Yzje6Pd4GWyJUkqcoX1aBLNS1vNcmKYEbbcQaS8DuwzS53kbvLy ZrHP8J3V3YBeTh7lYI/8MxkUUNFetLA47quuerdG+utYnZMLHe5C/w0HQg== X-Google-Smtp-Source: AGHT+IHVoGIqA4I3Mkv+ouiHaM99IJVATnfoGMJsL8ecropyPNt1rcv25HrPOCFORB7HVGpLXPRgfQ== X-Received: by 2002:a17:902:6bc9:b0:1e4:6938:6fe3 with SMTP id m9-20020a1709026bc900b001e469386fe3mr1667445plt.58.1714557528364; Wed, 01 May 2024 02:58:48 -0700 (PDT) Received: from Thaum. (121-44-11-123.tpgi.com.au. [121.44.11.123]) by smtp.gmail.com with ESMTPSA id f18-20020a170902ce9200b001dde004b31bsm9096708plg.166.2024.05.01.02.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 02:58:47 -0700 (PDT) Message-ID: <66321257.170a0220.326c5.1f68@mx.google.com> X-Google-Original-Message-ID: Date: Wed, 1 May 2024 19:58:41 +1000 From: Nathaniel Shead To: gcc-patches@gcc.gnu.org Cc: Jason Merrill , Nathan Sidwell , Patrick Palka Subject: [PATCH 0/4] c++/modules: Fix missed GMF discarding MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org This patch series fixes a number of issues with declarations in the GMF not correctly getting discarded, and ending up in the module CMI. The most noticeable outcome of this is users running very quickly into issues with including a header after those names have already been provided by an 'import'; this should go away once we implement deduplication of textual redefinitions, but it's still worth discarding as it otherwise inflates the size of the CMI with unused declarations. Nathaniel Shead (4): c++: Don't emit unused GMF partial specializations [PR114630] c++: Track module purview for deferred instantiations [PR114630] c++: Also track module purview from deferred vtable instantiation [PR114630] c++: Add new xtreme-header testcase for GMF discarding gcc/cp/cp-tree.h | 3 + gcc/cp/decl2.cc | 11 ++- gcc/cp/module.cc | 75 ++++++++++++------- gcc/cp/pt.cc | 4 + gcc/testsuite/g++.dg/modules/gmf-3.C | 13 ++++ gcc/testsuite/g++.dg/modules/gmf-4.C | 27 +++++++ gcc/testsuite/g++.dg/modules/partial-3.C | 20 +++++ .../g++.dg/modules/xtreme-header-8.C | 9 +++ gcc/testsuite/g++.dg/modules/xtreme-header.h | 24 ++++-- 9 files changed, 147 insertions(+), 39 deletions(-) create mode 100644 gcc/testsuite/g++.dg/modules/gmf-3.C create mode 100644 gcc/testsuite/g++.dg/modules/gmf-4.C create mode 100644 gcc/testsuite/g++.dg/modules/partial-3.C create mode 100644 gcc/testsuite/g++.dg/modules/xtreme-header-8.C