From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 8D7663856DD8 for ; Tue, 2 Aug 2022 06:34:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D7663856DD8 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 538B92021F for ; Tue, 2 Aug 2022 06:34:49 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 4E04F2C141 for ; Tue, 2 Aug 2022 06:34:49 +0000 (UTC) Date: Tue, 2 Aug 2022 06:34:48 +0000 (UTC) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] lto/106334 - fix previous fix wrt -flto-partition=none User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2022 06:34:52 -0000 Message-ID: <20220802063448.aZu4DgPN7kvoFw6i4Uv-xk901fprNHykUmrn50O2dGU@z> This adjusts the assert guard to include -flto-partition=none which behaves as WPA. Bootstrapped & tested on x86_64-unknown-linux-gnu, pushed. PR lto/106334 * dwarf2out.cc (dwarf2out_register_external_die): Adjust assert. --- gcc/dwarf2out.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 3ac39c1a5b0..cfea9cf6451 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -6069,11 +6069,12 @@ dwarf2out_register_external_die (tree decl, const char *sym, if (!external_die_map) external_die_map = hash_map::create_ggc (1000); - /* When we do tree merging during WPA we can end up re-using GC memory - as there's currently no way to unregister external DIEs. Ideally - we'd register them only after merging finished but allowing override - here is easiest. See PR106334. */ - gcc_checking_assert (flag_wpa || !external_die_map->get (decl)); + /* When we do tree merging during WPA or with -flto-partition=none we + can end up re-using GC memory as there's currently no way to unregister + external DIEs. Ideally we'd register them only after merging finished + but allowing override here is easiest. See PR106334. */ + gcc_checking_assert (!(in_lto_p && !flag_wpa) + || !external_die_map->get (decl)); sym_off_pair p = { IDENTIFIER_POINTER (get_identifier (sym)), off }; external_die_map->put (decl, p); } -- 2.35.3