Hi,

On Thu, Oct 22 2020, Martin Liška wrote:
> All right, there's a patch that works for me.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
> Thanks,
> Martin
> From 33c58cab6bc0d779b11e7ffb36bfb485d73d6816 Mon Sep 17 00:00:00 2001
> From: Martin Liska <mli...@suse.cz>
> Date: Wed, 21 Oct 2020 11:11:03 +0200
> Subject: [PATCH] LTO: get_section: add new argument
>
> gcc/ChangeLog:
>
>       PR lto/97508
>       * langhooks.c (lhd_begin_section): Call get_section with
>       not_existing = true.
>       * output.h (get_section): Add new argument.
>       * varasm.c (get_section): Fail when NOT_EXISTING is true
>       and a section already exists.
>       * ipa-cp.c (ipcp_write_summary): Remove.
>       (ipcp_read_summary): Likewise.
>       * ipa-fnsummary.c (ipa_fn_summary_read): Always read jump
>       functions summary.
>       (ipa_fn_summary_write): Always stream it.

the ipa bits are OK.  One nit...

[...]

> diff --git a/gcc/varasm.c b/gcc/varasm.c
> index ea0b59cf44a..207c9b077d1 100644
> --- a/gcc/varasm.c
> +++ b/gcc/varasm.c
> @@ -297,6 +299,12 @@ get_section (const char *name, unsigned int flags, tree 
> decl)
>      }
>    else
>      {
> +      if (not_existing)
> +     {
> +       error ("Section already exists: %qs", name);

...is that I think this should be internal_error.  I am not sure what
difference it makes in practice, if any, though.

Thanks,

Martin


> +       gcc_unreachable ();
> +     }
> +
>        sect = *slot;
>        /* It is fine if one of the sections has SECTION_NOTYPE as long as
>           the other has none of the contrary flags (see the logic at the end
> -- 
> 2.28.0

Reply via email to