On December 31, 2020 8:02:37 AM GMT+01:00, "Kewen.Lin" <li...@linux.ibm.com> wrote: >Hi, > >As PR98464 shows, this patch is to make rpo_vn_valueize >consider the definition basic block of name, to sync >with what we do in function eliminate_stmt. > >Bootstrapped/regtested on powerpc64le-linux-gnu P9. > >Full SPEC2017 build/run passed on P9.
Note it is incorrect to query availability at the context of a value, so the patch isn't correct. I'll have a look after I return from vacation. Richard. >BR, >Kewen > >gcc/ChangeLog: > > PR tree-optimization/98464 > * tree-ssa-sccvn.c (rpo_vn_valueize): Use the def basic block > to keep consistent with eliminate_stmt. > >gcc/testsuite/ChangeLog: > > PR tree-optimization/98464 > * g++.dg/tree-ssa/pr98464.C: New test. > >---