@@ -6069,12 +6069,7 @@ 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 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));
+ gcc_checking_assert (!external_die_map->get (decl));
sym_off_pair p = { IDENTIFIER_POINTER (get_identifier (sym)), off };
external_die_map->put (decl, p);
}
@@ -1699,11 +1699,14 @@ lto_read_tree_1 (class lto_input_block *ib, class data_in *data_in, tree expr)
/* Read all the pointer fields in EXPR. */
streamer_read_tree_body (ib, data_in, expr);
- /* Read any LTO-specific data not read by the tree streamer. */
+ /* Read any LTO-specific data not read by the tree streamer. Do not use
+ stream_read_tree here since that flushes the dref_queue in mids of
+ SCC reading. */
if (DECL_P (expr)
&& TREE_CODE (expr) != FUNCTION_DECL
&& TREE_CODE (expr) != TRANSLATION_UNIT_DECL)
- DECL_INITIAL (expr) = stream_read_tree (ib, data_in);
+ DECL_INITIAL (expr)
+ = lto_input_tree_1 (ib, data_in, streamer_read_record_start (ib), 0);
/* Stream references to early generated DIEs. Keep in sync with the
trees handled in dwarf2out_register_external_die. */