diff options
author | Feng Xue <fxue@os.amperecomputing.com> | 2020-02-17 17:07:04 +0800 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 2020-02-21 13:22:20 -0700 |
commit | 47772af10c00f7e1e95cd52557fc893dc602a420 (patch) | |
tree | d7da2bfb62c51381fef0882ce16fa1889d23d983 /gcc/ipa-cp.c | |
parent | 147add96091790d5c1d8eb938f84ea775ad81b84 (diff) | |
download | gcc-47772af10c00f7e1e95cd52557fc893dc602a420.zip gcc-47772af10c00f7e1e95cd52557fc893dc602a420.tar.gz gcc-47772af10c00f7e1e95cd52557fc893dc602a420.tar.bz2 |
Do not propagate self-dependent value (PR ipa/93763)
PR ipa/93763
* ipa-cp.c (self_recursively_generated_p): Mark self-dependent value as
self-recursively generated.
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 4f5b72e..1d0c1ac 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); |