]> git.ipfire.org Git - thirdparty/gcc.git/commit
Don't use PHI equivalences in range-on-entry.
authorAndrew MacLeod <amacleod@redhat.com>
Fri, 16 Dec 2022 21:53:31 +0000 (16:53 -0500)
committerAndrew MacLeod <amacleod@redhat.com>
Tue, 20 Dec 2022 14:15:23 +0000 (09:15 -0500)
commit0bdd2261c254f08b0f4437c156b79711d68c6e7f
tree44d559b9833295b7b2c2eb709e309644a1f82144
parent05b7cf52e1b640271900894a894da2d27ef90092
Don't use PHI equivalences in range-on-entry.

If there is only one argument to a PHI which is defined, an equivalency is
created between the def and the argument.  It is safe to consider the def
equal to the argument, but it is dangerous to assume the argument is also
equivalent to the def as there may be branches which change the range on the
path to the PHI on that argument

This patch avoid using that relation in range-on-entry calculations.

PR tree-optimization/108139
gcc/
* gimple-range-cache.cc (ranger_cache::fill_block_cache): Do not
use equivalences originating from PHIS.

gcc/testsuite/
* gcc.dg/pr108139.c: New.
gcc/gimple-range-cache.cc
gcc/testsuite/gcc.dg/pr108139.c [new file with mode: 0644]