Once a range becomes constant, make it invariant.
authorAndrew MacLeod <amacleod@redhat.com>
Mon, 17 May 2021 19:53:39 +0000 (15:53 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Mon, 17 May 2021 22:11:24 +0000 (18:11 -0400)
commit3f476de7fd274f619a0b04c2e2f7077ee8ab17a5
tree043de12912155b313456535691049de649e06284
parent5282b2ac00148a39d7ae09821d64dbc9c32cbf5f
Once a range becomes constant, make it invariant.

Once a range is forced to a constant globally, simply make it invariant.
Unify this with the code which makes non-zero pointer ranges invariant.

gcc/
PR tree-optimization/100512
* gimple-range-cache.cc (ranger_cache::set_global_range): Mark const
and non-zero pointer ranges as invariant.
* gimple-range.cc (gimple_ranger::range_of_stmt): Remove pointer
processing from here.

gcc/testsuite/
PR tree-optimization/100512
* gcc.dg/pr100512.c: New.
gcc/gimple-range-cache.cc
gcc/gimple-range.cc
gcc/testsuite/gcc.dg/pr100512.c [new file with mode: 0644]