aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2018-05-22 19:10:34 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2018-05-22 12:10:34 -0700
commitaab778d3825052d262e3fc6d87af67e7cc196273 (patch)
treef88364764fd0a5dbf2703b09f278a52dcaaddaef /gcc/varasm.c
parent58c2ad42a89438281327c74afb3f7483ffe22514 (diff)
downloadgcc-aab778d3825052d262e3fc6d87af67e7cc196273.zip
gcc-aab778d3825052d262e3fc6d87af67e7cc196273.tar.gz
gcc-aab778d3825052d262e3fc6d87af67e7cc196273.tar.bz2
Don't mark IFUNC resolver as only called directly
Since IFUNC resolver is called indirectly, don't mark IFUNC resolver as only called directly. This patch adds ifunc_resolver to cgraph_node, sets ifunc_resolver for ifunc attribute and checks ifunc_resolver instead of looking up ifunc attribute. gcc/ PR target/85345 * cgraph.h (cgraph_node::create): Set ifunc_resolver for ifunc attribute. (cgraph_node::create_alias): Likewise. (cgraph_node::get_availability): Check ifunc_resolver instead of looking up ifunc attribute. * cgraphunit.c (maybe_diag_incompatible_alias): Likewise. * varasm.c (do_assemble_alias): Likewise. (assemble_alias): Likewise. (default_binds_local_p_3): Likewise. * cgraph.h (cgraph_node): Add ifunc_resolver. (cgraph_node::only_called_directly_or_aliased_p): Return false for IFUNC resolver. * lto-cgraph.c (input_node): Set ifunc_resolver for ifunc attribute. * symtab.c (symtab_node::verify_base): Verify that ifunc_resolver is equivalent to lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl)). (symtab_node::binds_to_current_def_p): Check ifunc_resolver instead of looking up ifunc attribute. gcc/testsuite/ PR target/85345 * gcc.target/i386/pr85345.c: New test. From-SVN: r260547
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 8cf6e1e..3bd9cbb 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -5833,7 +5833,8 @@ do_assemble_alias (tree decl, tree target)
globalize_decl (decl);
maybe_assemble_visibility (decl);
}
- if (lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl)))
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ && cgraph_node::get (decl)->ifunc_resolver)
{
#if defined (ASM_OUTPUT_TYPE_DIRECTIVE)
if (targetm.has_ifunc_p ())
@@ -5916,7 +5917,7 @@ assemble_alias (tree decl, tree target)
# else
if (!DECL_WEAK (decl))
{
- if (lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl)))
+ if (cgraph_node::get (decl)->ifunc_resolver)
error_at (DECL_SOURCE_LOCATION (decl),
"ifunc is not supported in this configuration");
else
@@ -7048,7 +7049,8 @@ default_binds_local_p_3 (const_tree exp, bool shlib, bool weak_dominate,
weakref alias. */
if (lookup_attribute ("weakref", DECL_ATTRIBUTES (exp))
|| (TREE_CODE (exp) == FUNCTION_DECL
- && lookup_attribute ("ifunc", DECL_ATTRIBUTES (exp))))
+ && cgraph_node::get (exp)
+ && cgraph_node::get (exp)->ifunc_resolver))
return false;
/* Static variables are always local. */