From 2fcccf21a34f92ea060b492c9b2aecb56cd5d167 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Tue, 3 Sep 2024 12:02:23 +0200 Subject: LTO/WPA: Ensure that output_offload_tables only writes table once [PR116535] When ltrans was written concurrently, e.g. via -flto=N (N > 1, assuming sufficient partiations, e.g., via -flto-partition=max), output_offload_tables wrote the output tables once per fork. PR lto/116535 gcc/ChangeLog: * lto-cgraph.cc (output_offload_tables): Remove offload_ frees. * lto-streamer-out.cc (lto_output): Make call to it depend on lto_get_out_decl_state ()->output_offload_tables_p. * lto-streamer.h (struct lto_out_decl_state): Add output_offload_tables_p field. * tree-pass.h (ipa_write_optimization_summaries): Add bool argument. * passes.cc (ipa_write_summaries_1): Add bool output_offload_tables_p arg. (ipa_write_summaries): Update call. (ipa_write_optimization_summaries): Accept output_offload_tables_p. gcc/lto/ChangeLog: * lto.cc (stream_out): Update call to ipa_write_optimization_summaries to pass true for first partition. --- gcc/tree-pass.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/tree-pass.h') diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 3a0cf13..a928cbe 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -684,7 +684,8 @@ extern void emergency_dump_function (void); extern void print_current_pass (FILE *); extern void debug_pass (void); extern void ipa_write_summaries (void); -extern void ipa_write_optimization_summaries (struct lto_symtab_encoder_d *); +extern void ipa_write_optimization_summaries (struct lto_symtab_encoder_d *, + bool); extern void ipa_read_summaries (void); extern void ipa_read_optimization_summaries (void); extern void register_one_dump_file (opt_pass *); -- cgit v1.1