This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug 14562 : copyrename & PRE
On Mon, 15 Mar 2004, Andrew MacLeod wrote:
> On Mon, 2004-03-15 at 13:27, Daniel Berlin wrote:
> >
> >
>
> >
> > Before the transformation, you have:
> > T.6<D1061>_13 = k<D1047>_26 * 4;
> > ...
> > T.2<D1056>_42 = T.1<D1055>_41 * 4;
> >
> > one lexical occurrence of k * 4, one lexical occurrence of T.1 * 4.
> >
> > after, you have
> > <L0>:;
> > T.6<D1061>_13 = k<D1047>_26 * 4;
> > ...
> > T.2<D1056>_42 = k<D1047>_41 * 4;
> >
> > two lexical occurrences of k * 4.
> >
>
> even tho k_41 has absolutely nothing to do with the 'k' in k_26 eh.
yes.
Braindead, i know.
This isn't as big a problem in other compilers because they don't have as
many different named temporaries for variables.
IE copyrename should improve PRE effectiveness in a lot of cases, at least
until we have GVN-PRE.
> > I looked at the code PRE generates for optimizing that expression by eye,
> > and it looks okay to me.
>
> OK, I'll see if I can see anyone else doing something bad then. someone
> is getting confused :-)
:P
It still could be PRE, and i'm just missing it.
But i traced the replacements it made by hand, and looked at the resulting
code, and it looks like it should be okay.