aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>2016-10-18 13:28:16 +0000
committerDavid Edelsohn <dje@gcc.gnu.org>2016-10-18 09:28:16 -0400
commit1b32951078029b56c6b35092e1fc739f1c66a1b3 (patch)
tree39cc2e4ce6982f8149a9bd17c81efb9145383439 /gcc
parente5163ec1df8755de70b711022314220318a0a441 (diff)
downloadgcc-1b32951078029b56c6b35092e1fc739f1c66a1b3.zip
gcc-1b32951078029b56c6b35092e1fc739f1c66a1b3.tar.gz
gcc-1b32951078029b56c6b35092e1fc739f1c66a1b3.tar.bz2
rs6000.c (rs6000_output_symbol_ref): Move storage mapping class decoration from here...
* config/rs6000/rs6000.c (rs6000_output_symbol_ref): Move storage mapping class decoration from here... (rs6000_xcoff_encode_section): ...to here. (rs6000_savres_strategy) [AIX,ELFv2]: Inline FPR save and restore if shrink-wrapping and optimizing for speed. From-SVN: r241303
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/rs6000/rs6000.c44
2 files changed, 31 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 80c9870..bd4435a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2016-10-18 David Edelsohn <dje.gcc@gmail.com>
+
+ * config/rs6000/rs6000.c (rs6000_output_symbol_ref): Move storage
+ mapping class decoration from here...
+ (rs6000_xcoff_encode_section): ...to here.
+
+ (rs6000_savres_strategy) [AIX,ELFv2]: Inline FPR save and restore
+ if shrink-wrapping and optimizing for speed.
+
2016-10-18 Richard Biener <rguenther@suse.de>
* tree-vrp.c (evrp_dom_walker::before_dom_children): Handle
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 2406d5c..1a0c4c0 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -25452,7 +25452,8 @@ rs6000_savres_strategy (rs6000_stack_t *info,
else
{
gcc_checking_assert (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2);
- if (info->first_fp_reg_save > 61)
+ if ((flag_shrink_wrap_separate && optimize_function_for_speed_p (cfun))
+ || info->first_fp_reg_save > 61)
strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
strategy |= SAVE_INLINE_VRS | REST_INLINE_VRS;
@@ -30680,31 +30681,14 @@ rs6000_xcoff_strip_dollar (const char *name)
void
rs6000_output_symbol_ref (FILE *file, rtx x)
{
+ const char *name = XSTR (x, 0);
+
/* Currently C++ toc references to vtables can be emitted before it
is decided whether the vtable is public or private. If this is
the case, then the linker will eventually complain that there is
a reference to an unknown section. Thus, for vtables only,
- we emit the TOC reference to reference the symbol and not the
- section. */
- const char *name = XSTR (x, 0);
-
- tree decl = SYMBOL_REF_DECL (x);
- if (decl /* sync condition with assemble_external () */
- && DECL_P (decl) && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)
- && (TREE_CODE (decl) == VAR_DECL
- || TREE_CODE (decl) == FUNCTION_DECL)
- && name[strlen (name) - 1] != ']')
- {
- name = concat (name,
- (TREE_CODE (decl) == FUNCTION_DECL
- ? "[DS]" : "[UA]"),
- NULL);
-
- /* Don't modify name in extern VAR_DECL to include mapping class. */
- if (TREE_CODE (decl) == FUNCTION_DECL)
- XSTR (x, 0) = name;
- }
-
+ we emit the TOC reference to reference the identifier and not the
+ symbol. */
if (VTABLE_NAME_P (name))
{
RS6000_OUTPUT_BASENAME (file, name);
@@ -35277,6 +35261,7 @@ rs6000_xcoff_encode_section_info (tree decl, rtx rtl, int first)
{
rtx symbol;
int flags;
+ const char *symname;
default_encode_section_info (decl, rtl, first);
@@ -35293,6 +35278,21 @@ rs6000_xcoff_encode_section_info (tree decl, rtx rtl, int first)
flags &= ~SYMBOL_FLAG_HAS_BLOCK_INFO;
SYMBOL_REF_FLAGS (symbol) = flags;
+
+ /* Append mapping class to extern decls. */
+ symname = XSTR (symbol, 0);
+ if (decl /* sync condition with assemble_external () */
+ && DECL_P (decl) && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)
+ && ((TREE_CODE (decl) == VAR_DECL && !DECL_THREAD_LOCAL_P (decl))
+ || TREE_CODE (decl) == FUNCTION_DECL)
+ && symname[strlen (symname) - 1] != ']')
+ {
+ char *newname = (char *) alloca (strlen (symname) + 5);
+ strcpy (newname, symname);
+ strcat (newname, (TREE_CODE (decl) == FUNCTION_DECL
+ ? "[DS]" : "[UA]"));
+ XSTR (symbol, 0) = ggc_strdup (newname);
+ }
}
#endif /* HAVE_AS_TLS */
#endif /* TARGET_XCOFF */