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

--- Comment #20 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by H.J. Lu <h...@gcc.gnu.org>:

https://gcc.gnu.org/g:574d52a9b6e40a466b90f4810e72d3dd072d5160

commit r11-11321-g574d52a9b6e40a466b90f4810e72d3dd072d5160
Author: H.J. Lu <hjl.to...@gmail.com>
Date:   Mon Feb 26 08:38:58 2024 -0800

    tree-profile: Disable indirect call profiling for IFUNC resolvers

    We can't profile indirect calls to IFUNC resolvers nor their callees as
    it requires TLS which hasn't been set up yet when the dynamic linker is
    resolving IFUNC symbols.

    Add an IFUNC resolver caller marker to cgraph_node and set it if the
    function is called by an IFUNC resolver.  Disable indirect call profiling
    for IFUNC resolvers and their callees.

    Tested with profiledbootstrap on Fedora 39/x86-64.

    gcc/ChangeLog:

            PR tree-optimization/114115
            * cgraph.h (symtab_node): Add check_ifunc_callee_symtab_nodes.
            (cgraph_node): Add called_by_ifunc_resolver.
            * cgraphunit.c (symbol_table::compile): Call
            symtab_node::check_ifunc_callee_symtab_nodes.
            * symtab.c (check_ifunc_resolver): New.
            (ifunc_ref_map): Likewise.
            (is_caller_ifunc_resolver): Likewise.
            (symtab_node::check_ifunc_callee_symtab_nodes): Likewise.
            * tree-profile.c (gimple_gen_ic_func_profiler): Disable indirect
            call profiling for IFUNC resolvers and their callees.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/114115
            * gcc.dg/pr114115.c: New test.

    (cherry picked from commit cab32bacaea268ec062b1fb4fc662d90c9d1cfce)

Reply via email to