diff options
author | Martin Liska <mliska@suse.cz> | 2020-10-21 11:11:03 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2020-10-29 14:32:48 +0100 |
commit | 568de14d2e74cfdd600b8995ff6ac08c98ddef48 (patch) | |
tree | e0fdddfddfbe226f14a78169dbb67153b8c32c1e /gcc/varasm.c | |
parent | 64817472be2ab6c89bd5448c242a191a38041bb9 (diff) | |
download | gcc-568de14d2e74cfdd600b8995ff6ac08c98ddef48.zip gcc-568de14d2e74cfdd600b8995ff6ac08c98ddef48.tar.gz gcc-568de14d2e74cfdd600b8995ff6ac08c98ddef48.tar.bz2 |
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.
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index ea0b59c..435c7b3 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -277,10 +277,12 @@ get_noswitch_section (unsigned int flags, noswitch_section_callback callback) } /* Return the named section structure associated with NAME. Create - a new section with the given fields if no such structure exists. */ + a new section with the given fields if no such structure exists. + When NOT_EXISTING, then fail if the section already exists. */ section * -get_section (const char *name, unsigned int flags, tree decl) +get_section (const char *name, unsigned int flags, tree decl, + bool not_existing) { section *sect, **slot; @@ -297,6 +299,9 @@ get_section (const char *name, unsigned int flags, tree decl) } else { + if (not_existing) + internal_error ("Section already exists: %qs", name); + 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 |