Commit ce9f2dc5 by Sandra Loosemore Committed by Sandra Loosemore

nios2.c (nios2_symbol_ref_in_small_data_p): For -mgpopt=local, also exclude…

nios2.c (nios2_symbol_ref_in_small_data_p): For -mgpopt=local, also exclude unintialized common symbols.

2015-10-06  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/
	* config/nios2/nios2.c (nios2_symbol_ref_in_small_data_p):
	For -mgpopt=local, also exclude unintialized common symbols.
	* doc/invoke.texi (Nios II Options): Document the change.

From-SVN: r228549
parent 64e9a944
2015-10-06 Sandra Loosemore <sandra@codesourcery.com>
* config/nios2/nios2.c (nios2_symbol_ref_in_small_data_p):
For -mgpopt=local, also exclude unintialized common symbols.
* doc/invoke.texi (Nios II Options): Document the change.
2015-10-07 Kugan Vivekanandarajah <kuganv@linaro.org> 2015-10-07 Kugan Vivekanandarajah <kuganv@linaro.org>
* config/aarch64/iterators.md (vwcore): Add missing cases for * config/aarch64/iterators.md (vwcore): Add missing cases for
...@@ -2099,13 +2099,17 @@ nios2_symbol_ref_in_small_data_p (rtx sym) ...@@ -2099,13 +2099,17 @@ nios2_symbol_ref_in_small_data_p (rtx sym)
case gpopt_local: case gpopt_local:
/* Use GP-relative addressing for small data symbols that are /* Use GP-relative addressing for small data symbols that are
not external or weak, plus any symbols that have explicitly not external or weak or uninitialized common, plus any symbols
been placed in a small data section. */ that have explicitly been placed in a small data section. */
if (decl && DECL_SECTION_NAME (decl)) if (decl && DECL_SECTION_NAME (decl))
return nios2_small_section_name_p (DECL_SECTION_NAME (decl)); return nios2_small_section_name_p (DECL_SECTION_NAME (decl));
return (SYMBOL_REF_SMALL_P (sym) return (SYMBOL_REF_SMALL_P (sym)
&& !SYMBOL_REF_EXTERNAL_P (sym) && !SYMBOL_REF_EXTERNAL_P (sym)
&& !(decl && DECL_WEAK (decl))); && !(decl && DECL_WEAK (decl))
&& !(decl && DECL_COMMON (decl)
&& (DECL_INITIAL (decl) == NULL
|| (!in_lto_p
&& DECL_INITIAL (decl) == error_mark_node))));
case gpopt_global: case gpopt_global:
/* Use GP-relative addressing for small data symbols, even if /* Use GP-relative addressing for small data symbols, even if
......
...@@ -18535,13 +18535,14 @@ Do not generate GP-relative accesses. ...@@ -18535,13 +18535,14 @@ Do not generate GP-relative accesses.
@item local @item local
Generate GP-relative accesses for small data objects that are not Generate GP-relative accesses for small data objects that are not
external or weak. Also use GP-relative addressing for objects that external, weak, or uninitialized common symbols.
Also use GP-relative addressing for objects that
have been explicitly placed in a small data section via a @code{section} have been explicitly placed in a small data section via a @code{section}
attribute. attribute.
@item global @item global
As for @samp{local}, but also generate GP-relative accesses for As for @samp{local}, but also generate GP-relative accesses for
small data objects that are external or weak. If you use this option, small data objects that are external, weak, or common. If you use this option,
you must ensure that all parts of your program (including libraries) are you must ensure that all parts of your program (including libraries) are
compiled with the same @option{-G} setting. compiled with the same @option{-G} setting.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment