> Hi Honza, > > On Thu, 11 Nov 2021 17:39:18 +0100 > Jan Hubicka via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > > diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c > > index 422b52fba4b..550bdeded16 100644 > > --- a/gcc/ipa-pure-const.c > > +++ b/gcc/ipa-pure-const.c > > @@ -1513,6 +1611,9 @@ propagate_pure_const (void) > > enum pure_const_state_e edge_state = IPA_CONST; > > bool edge_looping = false; > > > > + if (e->recursive_p ()) > > + looping = true; > > + > > if (e->recursive_p ()) > > looping = true; > > > > This seems redundant, no?
Yes, artifact of breaking up the patch :( I also noticed that I mixed up looping flag (there are two variables one called looping and other this_looping while the second is one I should use and first is one I used) Fixed as follows. gcc/ChangeLog: * ipa-pure-const.c (propagate_pure_const): Remove redundant check; fix call of ipa_make_function_const and ipa_make_function_pure. diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index b831844afa6..5056850c0a8 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -1611,9 +1611,6 @@ propagate_pure_const (void) enum pure_const_state_e edge_state = IPA_CONST; bool edge_looping = false; - if (e->recursive_p ()) - looping = true; - if (e->recursive_p ()) looping = true; @@ -1800,11 +1797,11 @@ propagate_pure_const (void) switch (this_state) { case IPA_CONST: - remove_p |= ipa_make_function_const (node, looping, false); + remove_p |= ipa_make_function_const (node, this_looping, false); break; case IPA_PURE: - remove_p |= ipa_make_function_pure (node, looping, false); + remove_p |= ipa_make_function_pure (node, this_looping, false); break; default: