Don't use gori dependencies to optimize.
authorAndrew MacLeod <amacleod@redhat.com>
Wed, 29 Jun 2022 17:34:05 +0000 (13:34 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 30 Jun 2022 01:37:21 +0000 (21:37 -0400)
commit918ccccbb0e78ae42bfcf808a1e93a8f6b9d02ea
tree83ae2acd54adb33ba626d31089e61fa1680fa1c4
parente484755aecd543b4c9e2adb4f348118c1e43cfd0
Don't use gori dependencies to optimize.

  The routine fold_using_range::relation_fold_and_or needs to veriyf that both
operands of 2 stmts are the same, and uses GORIs dependency cache for this.
This cache cannot be counted on to reflect the current contents of a
stmt, expecially in the presence of an IL changing pass.  Instead, look at the
statement operands.

PR tree-optimization/106114
gcc/
* gimple-range-fold.cc (fold_using_range::relation_fold_and_or): Check
statement operands instead of GORI cache.
gcc/testsuite/
* gcc.dg/pr106114.c: New.
gcc/gimple-range-fold.cc
gcc/testsuite/gcc.dg/pr106114.c [new file with mode: 0644]