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

--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Jambor <jamb...@gcc.gnu.org>:

https://gcc.gnu.org/g:c4a92a9117a034e7cf291ae51d8b9b844fb5a88b

commit r13-4238-gc4a92a9117a034e7cf291ae51d8b9b844fb5a88b
Author: Martin Jambor <mjam...@suse.cz>
Date:   Tue Nov 22 18:22:03 2022 +0100

    ipa-cp: Do not be too optimistic about self-recursive edges (PR 107661)

    PR 107661 shows that function push_agg_values_for_index_from_edge
    should not attempt to optimize self-recursive call graph edges when
    called from cgraph_edge_brings_all_agg_vals_for_node.  Unlike when
    being called from find_aggregate_values_for_callers_subset, we cannot
    expect that any cloning for constants would lead to the edge leading
    from a new clone to the same new clone, in this case it would only be
    redirected to a new callee.

    Fixed by adding a parameter to push_agg_values_from_edge whether being
    optimistic about self-recursive edges is possible.

    gcc/ChangeLog:

    2022-11-22  Martin Jambor  <mjam...@suse.cz>

            PR ipa/107661
            * ipa-cp.cc (push_agg_values_from_edge): New parameter
            optimize_self_recursion, use it to decide whether to pass interim
to
            the helper function.
            (find_aggregate_values_for_callers_subset): Pass true in the new
            parameter of push_agg_values_from_edge.
            (cgraph_edge_brings_all_agg_vals_for_node): Pass false in the new
            parameter of push_agg_values_from_edge.

    gcc/testsuite/ChangeLog:

    2022-11-22  Martin Jambor  <mjam...@suse.cz>

            PR ipa/107661
            * g++.dg/ipa/pr107661.C: New test.

Reply via email to