Don't use gori depedencies to optimize.
authorAndrew MacLeod <amacleod@redhat.com>
Mon, 4 Jul 2022 15:21:34 +0000 (11:21 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Mon, 4 Jul 2022 17:21:48 +0000 (13:21 -0400)
commitd4738cbb02e201c031a2a44d8bc10d3e17d987dc
tree66c0a36c77d4c63ff8d7a2dbba4df8015c8d15fd
parent32dfb075ad31413af9086ce546b5f5317a916d34
Don't use gori depedencies to optimize.

  The routine fold_using_range::relation_fold_and_or needs to verify 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]