diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2018-05-28 13:44:18 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2018-05-28 06:44:18 -0700 |
commit | fed0325cf7beed5d15b2491b37420ceb4c6f2bbd (patch) | |
tree | d410a47e729840041795b6da0f00fa9cb597fa30 /gcc/symtab.c | |
parent | 1c40e05b72604621eb33b5102d2055f87f6779eb (diff) | |
download | gcc-fed0325cf7beed5d15b2491b37420ceb4c6f2bbd.zip gcc-fed0325cf7beed5d15b2491b37420ceb4c6f2bbd.tar.gz gcc-fed0325cf7beed5d15b2491b37420ceb4c6f2bbd.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/
Backport from mainline
2018-05-26 H.J. Lu <hongjiu.lu@intel.com>
PR target/85900
PR target/85345
* varasm.c (assemble_alias): Lookup ifunc attribute on error.
2018-05-24 H.J. Lu <hongjiu.lu@intel.com>
PR target/85900
PR target/85345
* varasm.c (assemble_alias): Check ifunc_resolver only on
FUNCTION_DECL.
2018-05-22 H.J. Lu <hongjiu.lu@intel.com>
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/
Backport from mainline
2018-05-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc.target/i386/pr85345.c: Require ifunc support.
2018-05-22 H.J. Lu <hongjiu.lu@intel.com>
PR target/85345
* gcc.target/i386/pr85345.c: New test.
From-SVN: r260849
Diffstat (limited to 'gcc/symtab.c')
-rw-r--r-- | gcc/symtab.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c index c153308..954920b 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -998,6 +998,13 @@ symtab_node::verify_base (void) error ("function symbol is not function"); error_found = true; } + else if ((lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl)) + != NULL) + != dyn_cast <cgraph_node *> (this)->ifunc_resolver) + { + error ("inconsistent `ifunc' attribute"); + error_found = true; + } } else if (is_a <varpool_node *> (this)) { @@ -2253,13 +2260,13 @@ symtab_node::binds_to_current_def_p (symtab_node *ref) if (transparent_alias) return definition && get_alias_target()->binds_to_current_def_p (ref); - if (lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl))) + cgraph_node *cnode = dyn_cast <cgraph_node *> (this); + if (cnode && cnode->ifunc_resolver) return false; if (decl_binds_to_current_def_p (decl)) return true; /* Inline clones always binds locally. */ - cgraph_node *cnode = dyn_cast <cgraph_node *> (this); if (cnode && cnode->global.inlined_to) return true; |