This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: allowing fold to change location of args (PR/41451)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 26 Oct 2009 17:13:05 +0100
- Subject: Re: RFC: allowing fold to change location of args (PR/41451)
- References: <20091026153944.GA24939@redhat.com>
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.