https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109695
--- Comment #15 from Andrew Macleod <amacleod at redhat dot com> --- (In reply to Mikael Morin from comment #8) > (In reply to Andrew Macleod from comment #7) > > > > diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc > > index 49e9d6b4de6..74afaaf2989 100644 > > --- a/gcc/gimple-range.cc > > +++ b/gcc/gimple-range.cc > > @@ -394,7 +394,9 @@ gimple_ranger::prefill_stmt_dependencies (tree ssa) > > Value_Range tmp (TREE_TYPE (name)); > > m_cache.get_global_range (tmp, name); > > r.intersect (tmp); > > - m_cache.set_global_range (name, r); > > + // Only update the global range if it changes. > > + if (r != tmp) > > + m_cache.set_global_range (name, r); > > } > > continue; > > } > > Maybe the result of intersect could be used to check for changes? > > if (tmp.intersect(r)) > ... Yes, my next iteration of the patch did just that.. however, its still not quite right, theres a ripple effect with the way we handle timestamps. the first time a name is processed, we set an "always current" timestamp until we resolve all the dependencies and get back to it to calculate a real value. If the initial value and the calculated value ends up being the same, the current fix won't clear the always-current timestamp.. still working on it.
