diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2019-02-27 20:14:55 +0000 |
---|---|---|
committer | Bernd Edlinger <edlinger@gcc.gnu.org> | 2019-02-27 20:14:55 +0000 |
commit | 5b0a9c7cc1fa723369df61598cd3a8af4d21f5ff (patch) | |
tree | f04317d13c45be937219c3ba8330c8303fdec480 /gcc | |
parent | 867a4ad28e118776bedc3bb2571d91c898aa3398 (diff) | |
download | gcc-5b0a9c7cc1fa723369df61598cd3a8af4d21f5ff.zip gcc-5b0a9c7cc1fa723369df61598cd3a8af4d21f5ff.tar.gz gcc-5b0a9c7cc1fa723369df61598cd3a8af4d21f5ff.tar.bz2 |
re PR rtl-optimization/89490 (char array constant put in string merge section)
2019-02-27 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR rtl-optimization/89490
* varasm.c (get_block_for_section): Bail out for mergeable sections.
(default_use_anchors_for_symbol_p, output_object_block): Assert the
block section is not mergeable.
From-SVN: r269264
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/varasm.c | 21 |
2 files changed, 21 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 95262b4..d7e81db 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-02-27 Bernd Edlinger <bernd.edlinger@hotmail.de> + + PR rtl-optimization/89490 + * varasm.c (get_block_for_section): Bail out for mergeable sections. + (default_use_anchors_for_symbol_p, output_object_block): Assert the + block section is not mergeable. + 2019-02-27 Jakub Jelinek <jakub@redhat.com> PR target/70341 diff --git a/gcc/varasm.c b/gcc/varasm.c index 84dc141..da10ba3 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -363,7 +363,11 @@ use_object_blocks_p (void) /* Return the object_block structure for section SECT. Create a new structure if we haven't created one already. Return null if SECT - itself is null. */ + itself is null. Return also null for mergeable sections since + section anchors can't be used in mergeable sections anyway, + because the linker might move objects around, and using the + object blocks infrastructure in that case is both a waste and a + maintenance burden. */ static struct object_block * get_block_for_section (section *sect) @@ -373,6 +377,9 @@ get_block_for_section (section *sect) if (sect == NULL) return NULL; + if (sect->common.flags & SECTION_MERGE) + return NULL; + object_block **slot = object_block_htab->find_slot_with_hash (sect, hash_section (sect), INSERT); @@ -7014,14 +7021,13 @@ default_asm_output_anchor (rtx symbol) bool default_use_anchors_for_symbol_p (const_rtx symbol) { - section *sect; tree decl; + section *sect = SYMBOL_REF_BLOCK (symbol)->sect; - /* Don't use anchors for mergeable sections. The linker might move - the objects around. */ - sect = SYMBOL_REF_BLOCK (symbol)->sect; - if (sect->common.flags & SECTION_MERGE) - return false; + /* This function should only be called with non-zero SYMBOL_REF_BLOCK, + furthermore get_block_for_section should not create object blocks + for mergeable sections. */ + gcc_checking_assert (sect && !(sect->common.flags & SECTION_MERGE)); /* Don't use anchors for small data sections. The small data register acts as an anchor for such sections. */ @@ -7630,6 +7636,7 @@ output_object_block (struct object_block *block) else switch_to_section (block->sect); + gcc_checking_assert (!(block->sect->common.flags & SECTION_MERGE)); assemble_align (block->alignment); /* Define the values of all anchors relative to the current section |