On Mon, Oct 26, 2009 at 9:37 AM, Aldy Hernandez <al...@redhat.com> wrote:
> We have two options:
>
> a) Allow locus changes in fold_checksum_tree.
> b) Fix fold-const throughout to make a copy of the result of fold_build*
> calls if we're about to change it's location-- in case fold is returning
> any of the original arguments.
>
> IMO (b) is too inefficient when we can easily do (a).

Except (b) is correct as fold should not be modifiying the tree at
all.  That is the whole point of fold_checksum_tree.  We allow some
things to change like TYPE_VARIANTs and such but we should not allow a
huge change like changing the locus on a statement inside fold.

Thanks,
Andrew Pinski

Reply via email to