diff --git a/gcc/toplev.cc b/gcc/toplev.cc index 5df59b79c80318246ba9f6d33246c489c9affdf1..62034c32b4aff32cdf2cb051bf9d0803b4730b3f 100644 --- a/gcc/toplev.cc +++ b/gcc/toplev.cc @@ -2433,6 +2433,7 @@ toplev::finalize (void) ira_costs_cc_finalize (); tree_cc_finalize (); reginfo_cc_finalize (); + varasm_cc_finalize (); /* save_decoded_options uses opts_obstack, so these must be cleaned up together. */ diff --git a/gcc/varasm.cc b/gcc/varasm.cc index 8e492e37fb08715f05711f6ccb9140fffe4ee5b0..c2540055421641caed08113d92dbeff7ffc09f49 100644 --- a/gcc/varasm.cc +++ b/gcc/varasm.cc @@ -8854,4 +8854,57 @@ handle_vtv_comdat_section (section *sect, const_tree decl ATTRIBUTE_UNUSED) switch_to_comdat_section(sect, DECL_NAME (decl)); } +void +varasm_cc_finalize () +{ + first_global_object_name = nullptr; + weak_global_object_name = nullptr; + + const_labelno = 0; + size_directive_output = 0; + + last_assemble_variable_decl = NULL_TREE; + first_function_block_is_cold = false; + saw_no_split_stack = false; + text_section = nullptr; + data_section = nullptr; + readonly_data_section = nullptr; + sdata_section = nullptr; + ctors_section = nullptr; + dtors_section = nullptr; + bss_section = nullptr; + sbss_section = nullptr; + tls_comm_section = nullptr; + comm_section = nullptr; + lcomm_section = nullptr; + bss_noswitch_section = nullptr; + exception_section = nullptr; + eh_frame_section = nullptr; + in_section = nullptr; + in_cold_section_p = false; + cold_function_name = NULL_TREE; + unnamed_sections = nullptr; + section_htab = nullptr; + object_block_htab = nullptr; + anchor_labelno = 0; + shared_constant_pool = nullptr; + pending_assemble_externals = NULL_TREE; + pending_libcall_symbols = nullptr; + +#ifdef ASM_OUTPUT_EXTERNAL + pending_assemble_externals_processed = false; + pending_assemble_externals_set = nullptr; +#endif + + weak_decls = NULL_TREE; + initial_trampoline = nullptr; + const_desc_htab = nullptr; + weakref_targets = NULL_TREE; + alias_pairs = nullptr; + tm_clone_hash = nullptr; + trampolines_created = 0; + elf_init_array_section = nullptr; + elf_fini_array_section = nullptr; +} + #include "gt-varasm.h" diff --git a/gcc/varasm.h b/gcc/varasm.h index d9311dc370bbf629205e06c512e64853ce39c998..f00ac7f3e5c9993f945c25e9b9069b8d7a858d22 100644 --- a/gcc/varasm.h +++ b/gcc/varasm.h @@ -81,4 +81,6 @@ extern rtx assemble_trampoline_template (void); extern void switch_to_comdat_section (section *, tree); +extern void varasm_cc_finalize (); + #endif // GCC_VARASM_H