From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A22623899016 for ; Tue, 2 May 2023 20:26:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A22623899016 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683059190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5YNlKuM0mad9eY7M90EVBkLY+UPPHulvO92sK8gsKmo=; b=KQ4yJMzB0dRxk05IBDqodKKKe0PRzj5tAW6a7hE7kTQc4T3l8krIwqLz70VLVC+IsFHG8f Z0b5UXsDyZL65/tU7SCnmuYJdYeVWbET2Kw9kVg9FZ0aLm+nluhnnIc6jBgDkIb6YCIyhs OWvZuLNzR9jPhm2OAnt4UTWF2EjVN+Q= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-LGk-fFrENIGcL_KRzHCgcQ-1; Tue, 02 May 2023 16:26:28 -0400 X-MC-Unique: LGk-fFrENIGcL_KRzHCgcQ-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-3ef691d1eebso23257951cf.3 for ; Tue, 02 May 2023 13:26:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683059188; x=1685651188; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5YNlKuM0mad9eY7M90EVBkLY+UPPHulvO92sK8gsKmo=; b=EUxVrLFvNYx96v0bxRt/aRLqjelLk5EQfFyUKSlO8XT1gStYvrHMlvn8CsiEz8wrIL +oEzH1BqpeIZRl9fapMDc9O9yooa0zzTmeIgX1Z4JwRs23n66nBLy3aIlVlFMG/M/a9w iUx4RqxG+amlplRdpPcyrBK4ETOK5SQuZXtw7jLEIo/yD6c6XotoeZstzPKeLVrhW20Z i24d6DC+fi6QuneZ2Y524KsPbnCsjvH1HlMfGN/E0t/EJzAzPHY4fdefLAJL72nQID9C JeLk9CT9o6ECQ96YhqkRHZdsEH6thATyZIuG+flSj9+0aHzVgzZ+C4juDSZoctHqFSGh 9j0A== X-Gm-Message-State: AC+VfDyTvbXAeZlUpTfC1YAydRnpqv32HltShMmmmbgRVSKayO2VWY0P bXRBc6CqRwmroCi0pOs/lS9ezKW4XCzLQIny6f5Dsi52Y6U/oVXflq0GyGbXEI2dmaIYl3Rhs3G AIA/PgAvYcxGAQMdZgDaunLuZoHoYJ1utac5HfYlwLzkvmjVs3V+euGDiSxpyjeAvyDApC07NGw == X-Received: by 2002:ac8:5b91:0:b0:3e6:71d6:5d5b with SMTP id a17-20020ac85b91000000b003e671d65d5bmr31183875qta.4.1683059188163; Tue, 02 May 2023 13:26:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ79jDRV3oXx1W9oilo1aBruXjgRRLwTbGqyU972gSOkY0he8OKC4IV+SB4DcB9dZASQTPFqgQ== X-Received: by 2002:ac8:5b91:0:b0:3e6:71d6:5d5b with SMTP id a17-20020ac85b91000000b003e671d65d5bmr31183848qta.4.1683059187841; Tue, 02 May 2023 13:26:27 -0700 (PDT) Received: from jason.com (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id h27-20020ac8777b000000b003ee2fb84d0dsm10622622qtu.11.2023.05.02.13.26.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 13:26:27 -0700 (PDT) From: Jason Merrill To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: less invalidate_class_lookup_cache Date: Tue, 2 May 2023 16:26:23 -0400 Message-Id: <20230502202623.1965601-1-jason@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.9 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_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- In the testcase below, we push_to_top_level to instantiate f and g, and they can both use the previous_class_level cache from instantiating A. Wiping the cache in pop_from_top_level is not helpful; we'll do that in pushclass if needed. template struct A { int i; void f() { i = 42; } void g() { i = 24; } }; int main() { A a; a.f(); a.g(); } gcc/cp/ChangeLog: * name-lookup.cc (pop_from_top_level): Don't invalidate_class_lookup_cache. --- gcc/cp/name-lookup.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index 7c61bc3bf61..8fd5733c1e2 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -8205,9 +8205,6 @@ pop_from_top_level (void) auto_cond_timevar tv (TV_NAME_LOOKUP); - /* Clear out class-level bindings cache. */ - if (previous_class_level) - invalidate_class_lookup_cache (); pop_class_stack (); release_tree_vector (current_lang_base); base-commit: bc24c51c0ccd64617864897ad071c98004ffc0a4 -- 2.31.1