On Mon, Jun 08, 2020 at 09:36:29PM +0200, Tobias Burnus wrote:
> I have now split-off the missed-optimization task to a new
> PR, PR95583, to be handled in a proper way instead of trying
> to cook-up a hackish special-case version.
>
> This patch now simply sets the force_output flag.
>
> (a) As output_offload_tables() (i.e. LTO streamout)
> comes very early, one could just set the force_output flag
> in this file without further checks or omp-offload.c changes
> (b) Alternatively, one check that it really works by using
> gcc_assert (symtab_node::get (it));
> in either or both files.
> (c) or assuming that some optimization worked, one could use:
> if (!symtab_node::get (it))
> continue;
>
> The patch does (c) as trimming it to (b) or (a) is trival.
I prefer the patch as is, output_offload_tables() isn't actually that early,
there are all the early optimizations before that.
And if we don't optimize it early enough, perhaps we need a targeted unused
target variable removal subpass (early ipa).
> OK? What about backporting to GCC 10?
Ok. Please wait a few days before backporting.
Jakub