On Fri, Jun 21, 2019 at 06:20:35PM +0200, Richard Biener wrote: > On June 21, 2019 5:50:45 PM GMT+02:00, Jakub Jelinek <ja...@redhat.com> wrote: > >On Fri, Jun 21, 2019 at 04:17:13PM +0200, Richard Biener wrote: > >> > >> The following fixes a quadraticness in reassoc. > >> > >> Bootstrap / regtest running on x86_64-unknown-linux-gnu. > > > >build_and_add_sum has several other callers, don't they need a similar > >change (or better do the gimple_set_visited (sum, true); inside of > >build_and_add_sum)? > > I didn't review them and thus wanted to only affect the caller I know is > problematic. Other callers might still Form unrelated chains?
I don't know, what I see is that we call gimple_set_visited (, true) in many spots we gimple_build_assign new statements so that we don't try to process them again during the pass, and the spots where this is not done look to me all like just forgotten thing rather than intent. There are several more spots, like force_into_ssa_name, optimize_range_tests_to_bit_test (my fault), optimize_range_tests_cmp_bitwise (too), optimize_range_tests_var_bound (too), attempt_builtin_copysign, reassociate_bb. Not sure about negate_value, repropagate_negates, those are most likely fine, the first one is done in a separate phase so most likely doesn't want visited to be set in there, after all that phase clears it. And repropagate_negates is called so late that nothing cares about visited in the pass anymore. Jakub