On Thu, 5 Jul 2007, Roman Zippel wrote:
> Hi,
>
> On Thu, 5 Jul 2007, Richard Guenther wrote:
>
> > If there is anything to fix, then all those variants should produce
> > the same code, not just foo3 and foo4. So for these cases we should
> > make sure that value-numbering sees them as computing the same value
> > and extend combine to choose the instructions with the least cost.
> >
> > Changing fold isn't a real fix. It's a workaround for a specific
> > testcase.
>
> What do you suggest now specifically?
> combine isn't the problem here, at the time we reach RTL this should
> already be done. Your patch only catches specific cases and pessimises
> others.
Well, that's always the nature of any canonicalization.
The following actually makes SCCVN notice that tmp1 == tmp2 in