RFC: allowing fold to change location of args (PR/41451)
Andrew Pinski
pinskia@gmail.com
Mon Oct 26 17:29:00 GMT 2009
On Mon, Oct 26, 2009 at 9:37 AM, Aldy Hernandez <aldyh@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
More information about the Gcc
mailing list