[PATCH] [GCC] Don't use section anchors for declarations that don't fit in a single anchor range

On behalf of Tamar Christina  <tamar.christina@arm.com>.

gcc/

	* varasm.c (default_use_anchors_for_symbol_p): Reject too large decls.


Co-Authored-By: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>

From-SVN: r239561
This commit is contained in:
Tamar Christina 2016-08-18 08:45:53 +00:00 committed by James Greenhalgh
parent eeead3a6f1
commit 65d21eaf70
2 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2016-08-18  Tamar Christina  <tamar.christina@arm.com>
Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
* varasm.c (default_use_anchors_for_symbol_p): Reject too large decls.
2016-08-18 Richard Biener <rguenther@suse.de>
* ssa-iterators.h (ssa_vuse_operand): New inline.

View File

@ -6793,6 +6793,15 @@ default_use_anchors_for_symbol_p (const_rtx symbol)
sections that should be marked as small in the section directive. */
if (targetm.in_small_data_p (decl))
return false;
/* Don't use section anchors for decls that won't fit inside a single
anchor range to reduce the amount of instructions require to refer
to the entire declaration. */
if (decl && DECL_SIZE (decl)
&& tree_to_shwi (DECL_SIZE (decl))
>= (targetm.max_anchor_offset * BITS_PER_UNIT))
return false;
}
return true;
}