https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100774
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andrew Macleod <amacl...@gcc.gnu.org>: https://gcc.gnu.org/g:1ffbfc2659e7e8fa5c5d633869870af8fca5e8ee commit r12-1134-g1ffbfc2659e7e8fa5c5d633869870af8fca5e8ee Author: Andrew MacLeod <amacl...@redhat.com> Date: Thu May 27 11:19:10 2021 -0400 Range invariant global values are also always current. when a range evolves to the point where it becomes a constant, it is marked as invariant. Rather than marking it as always_current in the timestamp, give it the correct timestamp and just never flag it as stale. This will allow other names which use this value to become stale and be recomputed using the newly invariant value. gcc/ PR tree-optimization/100774 * gimple-range-cache.cc (ranger_cache::get_non_stale_global_range): Constant values are also not stale. (ranger_cache::set_global_range): Range invariant values should also have the correct timestamp. gcc/testsuite PR tree-optimization/100774 * g++.dg/pr100774.C: New.