]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lto/106334 - fix previous fix wrt -flto-partition=none
authorRichard Biener <rguenther@suse.de>
Mon, 1 Aug 2022 08:06:49 +0000 (10:06 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 2 Aug 2022 06:35:01 +0000 (08:35 +0200)
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.

gcc/dwarf2out.cc

index 3ac39c1a5b0a83b050f12c68f7726bafbc145c8d..cfea9cf6451790e16cb246b5b259f8b71dd4ba21 100644 (file)
@@ -6069,11 +6069,12 @@ dwarf2out_register_external_die (tree decl, const char *sym,
 
   if (!external_die_map)
     external_die_map = hash_map<tree, sym_off_pair>::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);
 }