Hi, On Tue, Feb 18 2020, Feng Xue OS wrote: > Currently, for self-recursive call, we never use value originated from > non-passthrough > jump function as source to avoid propagation explosion, but self-dependent > value is > missed. This patch is made to fix the bug. > > Bootstrapped/regtested on x86_64-linux and aarch64-linux. > > Feng > --- > 2020-02-18 Feng Xue <f...@os.amperecomputing.com> > > PR ipa/93763 > * ipa-cp.c (self_recursively_generated_p): Mark self-dependent value > as > self-recursively generated.
Honza, this is OK. Thanks, Martin > From 1ff803f33de0fe86d526deb23af2d08c15028ff9 Mon Sep 17 00:00:00 2001 > From: Feng Xue <f...@os.amperecomputing.com> > Date: Mon, 17 Feb 2020 17:07:04 +0800 > Subject: [PATCH] Do not propagate self-dependent value (PR ipa/93763) > > --- > gcc/ipa-cp.c | 10 ++++--- > gcc/testsuite/g++.dg/ipa/pr93763.C | 15 ++++++++++ > gcc/testsuite/gcc.dg/ipa/pr93763.c | 46 ++++++++++++++++++++++++++++++ > 3 files changed, 67 insertions(+), 4 deletions(-) > create mode 100644 gcc/testsuite/g++.dg/ipa/pr93763.C > create mode 100644 gcc/testsuite/gcc.dg/ipa/pr93763.c > > diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c > index 4f5b72e6994..1d0c1ac0f35 100644 > --- a/gcc/ipa-cp.c > +++ b/gcc/ipa-cp.c > @@ -1897,8 +1897,8 @@ ipcp_lattice<valtype>::add_value (valtype newval, > cgraph_edge *cs, > } > > /* Return true, if a ipcp_value VAL is orginated from parameter value of > - self-feeding recursive function by applying non-passthrough arithmetic > - transformation. */ > + self-feeding recursive function via some kind of pass-through jump > + function. */ > > static bool > self_recursively_generated_p (ipcp_value<tree> *val) > @@ -1909,10 +1909,12 @@ self_recursively_generated_p (ipcp_value<tree> *val) > { > cgraph_edge *cs = src->cs; > > - if (!src->val || cs->caller != cs->callee->function_symbol () > - || src->val == val) > + if (!src->val || cs->caller != cs->callee->function_symbol ()) > return false; > > + if (src->val == val) > + continue; > + > if (!info) > info = IPA_NODE_REF (cs->caller); >