From 1b32951078029b56c6b35092e1fc739f1c66a1b3 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Tue, 18 Oct 2016 13:28:16 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 9 ++++++++ gcc/config/rs6000/rs6000.c | 44 +++++++++++++++++++------------------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 80c9870e7cb..bd4435a4b37 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2016-10-18 David Edelsohn + + * 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 * 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 2406d5c64b0..1a0c4c0fe42 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 */ -- 2.30.2