Re: [PATCH] tree-optimization/106922 - missed FRE/PRE

2022-09-23 Thread Richard Biener via Gcc-patches
On Fri, 23 Sep 2022, Jakub Jelinek wrote: > On Thu, Sep 22, 2022 at 01:10:08PM +0200, Richard Biener via Gcc-patches > wrote: > > * g++.dg/tree-ssa/pr106922.C: Adjust. > > > --- a/gcc/testsuite/g++.dg/tree-ssa/pr106922.C > > +++ b/gcc/testsuite/g++.dg/tree-ssa/pr106922.C > > @@ -87,5 +87,4 @

Re: [PATCH] tree-optimization/106922 - missed FRE/PRE

2022-09-23 Thread Jakub Jelinek via Gcc-patches
On Thu, Sep 22, 2022 at 01:10:08PM +0200, Richard Biener via Gcc-patches wrote: > * g++.dg/tree-ssa/pr106922.C: Adjust. > --- a/gcc/testsuite/g++.dg/tree-ssa/pr106922.C > +++ b/gcc/testsuite/g++.dg/tree-ssa/pr106922.C > @@ -87,5 +87,4 @@ void testfunctionfoo() { >} > } > > -// { dg-fi

[PATCH] tree-optimization/106922 - missed FRE/PRE

2022-09-22 Thread Richard Biener via Gcc-patches
The following enhances the store-with-same-value trick in vn_reference_lookup_3 by not only looking for a = val; *ptr = val; .. = a; but also *ptr = val; other = x; .. = a; where the earlier store is more than one hop away. It does this by queueing the actual value to compare until