From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id B86FD385EC53; Tue, 2 Aug 2022 06:35:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B86FD385EC53 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1925] lto/106334 - fix previous fix wrt -flto-partition=none X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: b9da686470d1c23929eefb401280ad8ba17e2a58 X-Git-Newrev: bc7526f6fca0e6ac3bd462ae54170fa464539148 Message-Id: <20220802063535.B86FD385EC53@sourceware.org> Date: Tue, 2 Aug 2022 06:35:35 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2022 06:35:35 -0000 https://gcc.gnu.org/g:bc7526f6fca0e6ac3bd462ae54170fa464539148 commit r13-1925-gbc7526f6fca0e6ac3bd462ae54170fa464539148 Author: Richard Biener Date: Mon Aug 1 10:06:49 2022 +0200 lto/106334 - fix previous fix wrt -flto-partition=none This adjusts the assert guard to include -flto-partition=none which behaves as WPA. PR lto/106334 * dwarf2out.cc (dwarf2out_register_external_die): Adjust assert. Diff: --- 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); }