https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116535

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> The forked processes may not write to any "global" data because forking
> makes that data not global ... instead any such "global" data has to be
> computed before forking.

Well, the data is "computed" before - just a means is missing to propagate the
information whether to output the offload tables should be written or not is
missing. The current call stack is:

With WPA, the code is run as follows:

 output_offload_tables
  stream_out_partitions_1
   stream_out
    ipa_write_optimization_summaries
     write_lto
      lto_output
       output_offload_tables

* * *

I see two possibilities, the quick one:

(A)

--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -463,0 +464 @@ struct lto_symtab_encoder_d
+  bool output_offload_tables;

setting it - and propagating it through.

(B)
Change how we output the tables. Currently, those bypass normal WPA and IPA
handling. Making them visible should avoid the 'force_output = 1' for all table
entries (and only require it for the tables themselves) - and presumably fix
this issue as well as fixing PR 95622.

* * *

Thoughts?

Reply via email to