This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make cdtor names stable for LTO (PR lto/91307).


On Thu, Aug 1, 2019 at 3:10 PM Martin Liška <mliska@suse.cz> wrote:
>
> Hi.
>
> In LTO WPA mode we don't have to append temp file name
> to the global cdtor function names.

Is that true?  You can link with -r -flinker-output=rel and use
multiple WPA phases whose results you then finally link.

So I don't think it's that easy.  You might be able to look at
all_translation_units, pick the one with a sensible name
(hmm, not sure if we actually have a name there) and the lowest
UID and use that?  Thus, make the set of involved source files
known and pick one.  Ah,

struct GTY(()) tree_translation_unit_decl {
  struct tree_decl_common common;
  /* Source language of this translation unit.  Used for DWARF output.  */
  const char * GTY((skip(""))) language;
  /* TODO: Non-optimization used to build this translation unit.  */
  /* TODO: Root of a partial DWARF tree for global types and decls.  */
};

so you might be able to get at a filename via the decls location,
I'm not sure.  Do we have any LTO records per "input file" where we
can stream main_input_filename to?

> It helps to have a reproducible
> builds with LTO mode.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2019-08-01  Martin Liska  <mliska@suse.cz>
>
>         PR lto/91307
>         * tree.c (get_file_function_name): Use "wpa" when
>         we are in WPA LTO mode.
> ---
>  gcc/tree.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]