https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85345

--- Comment #5 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Mon May 28 13:44:18 2018
New Revision: 260849

URL: https://gcc.gnu.org/viewcvs?rev=260849&root=gcc&view=rev
Log:
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...@intel.com>

        PR target/85900
        PR target/85345
        * varasm.c (assemble_alias): Lookup ifunc attribute on error.

        2018-05-24  H.J. Lu  <hongjiu...@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...@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  <r...@cebitec.uni-bielefeld.de>

        * gcc.target/i386/pr85345.c: Require ifunc support.

        2018-05-22  H.J. Lu  <hongjiu...@intel.com>

        PR target/85345
        * gcc.target/i386/pr85345.c: New test.

Added:
    branches/gcc-8-branch/gcc/testsuite/gcc.target/i386/pr85345.c
Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/cgraph.c
    branches/gcc-8-branch/gcc/cgraph.h
    branches/gcc-8-branch/gcc/cgraphunit.c
    branches/gcc-8-branch/gcc/lto-cgraph.c
    branches/gcc-8-branch/gcc/symtab.c
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
    branches/gcc-8-branch/gcc/varasm.c

Reply via email to