I've submitted a bug tracker, 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93707.

The root cause is that for a self-recursive function, a for-all-contexts clone 
could generate
an edge whose callee is not the function. Therefore, to check whether an edge 
stands for a
recursive call during cloning, we should not use ordinary way of comparing 
caller and callee
of the edge.

Bootstrapped/regtested on x86_64-linux and aarch64-linux, and also tested Spec 
2017 with
option "--param ipa-cp-eval-threshold=1". 

Feng
---
2020-02-13  Feng Xue  <f...@os.amperecomputing.com>

        PR ipa/93707
        * ipa-cp.c (self_recursive_pass_through_p): Add a new parameter "node",
        and check recursiveness by comparing "node" and cs->caller.
        (self_recursive_agg_pass_through_p): Likewise.
        (find_more_scalar_values_for_callers_subset): Add "node" argument to
        self_recursive_pass_through_p call.
        (intersect_aggregates_with_edge): Add a new parameter "node", and add
        "node" argument to self_cursive_agg_pass_through_p call.
        (find_aggregate_values_for_callers_subset): Add "node" argument to
        self_recursive_pass_through_p and intersect_aggregates_with_edge calls.
        (cgraph_edge_brings_all_agg_vals_for_node): Add "node" argument to
        intersect_aggregates_with_edge call.

> ________________________________________
> From: gcc-patches-ow...@gcc.gnu.org <gcc-patches-ow...@gcc.gnu.org>
> on behalf of Tamar Christina <tamar.christ...@arm.com>
> Sent: Tuesday, February 11, 2020 6:05 PM
> To: Feng Xue OS; Martin Jambor; Jan Hubicka; gcc-patches@gcc.gnu.org
> Cc: nd
> Subject: RE: [PATCH V2] Generalized value pass-through for self-recursive
> function (ipa/pr93203)
>
> Hi Feng,
>
> This patch (commit a0f6a8cb414b687f22c9011a894d5e8e398c4be0) is causing
> ICEs in the GCC and perlbench benchmark in Spec2017.
>
> during IPA pass: cp
> lto1: internal compiler error: in find_more_scalar_values_for_callers_subset,
> at ipa-cp.c:4709
> 0x1698187 find_more_scalar_values_for_callers_subset
>         ../.././gcc/ipa-cp.c:4709
> 0x169f7d3 decide_about_value<tree_node*>
>         ../.././gcc/ipa-cp.c:5490
> 0x169fdc3 decide_whether_version_node
>         ../.././gcc/ipa-cp.c:5537
> 0x169fdc3 ipcp_decision_stage
>         ../.././gcc/ipa-cp.c:5718
> 0x169fdc3 ipcp_driver
>         ../.././gcc/ipa-cp.c:5901
> Please submit a full bug report,
>
> Thanks,
> Tamar
>

Attachment: 0001-Fix-bug-in-recursiveness-check-for-function-in-clone.patch
Description: 0001-Fix-bug-in-recursiveness-check-for-function-in-clone.patch

Reply via email to