This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: allowing fold to change location of args (PR/41451)


On Mon, Oct 26, 2009 at 4:39 PM, Aldy Hernandez <aldyh@redhat.com> wrote:
> Hi folks.
>
> In this PR the problem is that a call to fold_build2_loc() returns one
> of the original arguments unchanged. ?In the code below we take this
> result and change its location before returning it.
>
> ? ? ?tem = fold_build2_loc (loc, code, type,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? fold_convert_loc (loc, TREE_TYPE (op0),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TREE_OPERAND (arg0, 1)), op1);
> ? ? ?protected_set_expr_location (tem, loc);
>
> When --enable-checking=fold, fold verifies that none of the arguments
> changed, which in this case it obviously does.
>
> Would be ok to allow a TREE_EXP's location to change within fold? ?That is,
> add locus (for TREE_EXP's) to the list of allowed changeable fields in
> fold_checksum_tree()?

Why?  It looks like the above should already take care of the
correct location via passing loc to fold_build2_loc.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]