diff options
author | Martin Liska <mliska@suse.cz> | 2017-08-11 10:14:54 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-08-11 08:14:54 +0000 |
commit | a8b522b483ebb8c972ecfde8779a7a6ec16aecd6 (patch) | |
tree | 9758313b56edfd190549a5e205c9576068fe786e /gcc/ipa-visibility.c | |
parent | 4c71a171edb5e21a89a08643abfe933a43bb5d6d (diff) |
Introduce TARGET_SUPPORTS_ALIASES
2017-08-11 Martin Liska <mliska@suse.cz>
* c-opts.c (c_common_post_options): Replace ASM_OUTPUT_DEF with
TARGET_SUPPORTS_ALIASES.
2017-08-11 Martin Liska <mliska@suse.cz>
* asan.c (asan_protect_global): Replace ASM_OUTPUT_DEF with
TARGET_SUPPORTS_ALIASES.
* cgraph.c (cgraph_node::create_same_body_alias): Likewise.
* ipa-visibility.c (can_replace_by_local_alias): Likewise.
(optimize_weakref): Likewise.
* symtab.c (symtab_node::noninterposable_alias): Likewise.
* varpool.c (varpool_node::create_extra_name_alias): Likewise.
* defaults.h: Introduce TARGET_SUPPORTS_ALIASES.
2017-08-11 Martin Liska <mliska@suse.cz>
* decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
TARGET_SUPPORTS_ALIASES.
(handle_tls_init): Likewise.
(note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
both arguments.
* optimize.c (can_alias_cdtor): Likewise.
From-SVN: r251048
Diffstat (limited to 'gcc/ipa-visibility.c')
-rw-r--r-- | gcc/ipa-visibility.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c index 998024893a5..b6bc870b11d 100644 --- a/gcc/ipa-visibility.c +++ b/gcc/ipa-visibility.c @@ -339,10 +339,10 @@ varpool_node::externally_visible_p (void) static bool can_replace_by_local_alias (symtab_node *node) { -#ifndef ASM_OUTPUT_DEF /* If aliases aren't supported, we can't do replacement. */ - return false; -#endif + if (!TARGET_SUPPORTS_ALIASES) + return false; + /* Weakrefs have a reason to be non-local. Be sure we do not replace them. */ while (node->transparent_alias && node->definition && !node->weakref) @@ -463,11 +463,6 @@ update_visibility_by_resolution_info (symtab_node * node) static void optimize_weakref (symtab_node *node) { -#ifdef ASM_OUTPUT_DEF - bool aliases_supported = true; -#else - bool aliases_supported = false; -#endif bool strip_weakref = false; bool static_alias = false; @@ -486,8 +481,8 @@ optimize_weakref (symtab_node *node) /* If we have definition of weakref's target and we know it binds locally, we can turn weakref to static alias. */ - if (target->definition && decl_binds_to_current_def_p (target->decl) - && aliases_supported) + if (TARGET_SUPPORTS_ALIASES + && target->definition && decl_binds_to_current_def_p (target->decl)) strip_weakref = static_alias = true; /* Otherwise we can turn weakref into transparent alias. This transformation may break asm statements which directly refers to symbol name and expect |