This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR33340, SSA corruption due to FRE
On Sat, 8 Sep 2007, Richard Guenther wrote:
> On 9/8/07, Daniel Berlin <dberlin@dberlin.org> wrote:
> > On 9/7/07, Richard Guenther <rguenther@suse.de> wrote:
> > >
> > > FRE replaces a load by a SSA_NAME that occurs in an abnormal PHI.
> > > Fixed by not value-numbering anything as such SSA_NAME.
> > >
> > > Danny, does this make sense?
> > >
> >
> > Well, it does have the value of the abnormal ssa name. It is simply
> > the case that we can't do any replacements with that ssa name.
> >
> > Thus, i'd rather block replacement than value numbering.
>
> I thought about this as well, but for
>
> b_2 = a_1(ab);
> c_3 = b_2;
>
> we would then value number c_3 as a_1(ab) and prevent FRE of things
> involving b_2 as well as a_1(ab). Which is what we see in the testcase
> for the PR. We have
>
> tmp_4 = a_2(ab);
> store = tmp_4;
> ...
> x_2 = store;
>
> with the patch we replace the load by tmp_4, but if we value number tmp_4
> as a_2(ab) we would try to replace it by a_2(ab) instead and thus reject it.
>
> ?
Btw, bootstrapped and tested on x86_64-unknown-linux-gnu for all
languages.
Richard.