This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] CCP and non-destructive folding problems
On Tue, 25 Feb 2003, Jeff Law wrote:
> In message <20030225152722 dot GA32721 at tornado dot toronto dot redhat dot com>, Diego Novillo w
> rites:
> >Oops. This means that:
> >
> >(a) evaluate_stmt() has to be careful when returning UNDEFINED.
> > The optimistic evaluation of PHI nodes may cause problems
> > like the one above. I fixed this particular one by copying
> > more code from the destructive folder into the
> > non-destructive folder.
> Copying or better yet sharing code between the folders is a good thing.
>
>
> >(b) The non-destructive and destructive folders must always
> > return the same values. I've added a (moderately expensive)
> > check for this in the final fold pass.
> No. They do not. This is wrong.
>
> The check is mildly interesting in that it can point out places where
> the non-destructive folder could be optimizing, but if we have a
> requirement that they return the same results, then something is
> wrong elsewhere (as I pointed out in my last message).
>
You pointed out, but you didn't explain why this is wrong.
Explain please.
How is it OK for the two versions of fold() to return different
values for the exact same expression?
Diego.