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
This commit is contained in:
David Edelsohn 2016-10-18 13:28:16 +00:00 committed by David Edelsohn
parent e5163ec1df
commit 1b32951078
2 changed files with 31 additions and 22 deletions

View file

@ -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

View file

@ -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 */