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 10:42 PM, Aldy Hernandez <aldyh@redhat.com> wrote:
>> Certainly better. ?But I fail to see why a different location would be
>> better than the original here. ?I assume all tokens have a correct initial
>> location. ?Then why is for example for int i; ?in (int) i the location of
>> the conversion a better location than the one of i in the folded result?
>
> I don't care either way.
>
> OK pending tests?

Ok.

Thanks,
Richard.

> ? ? ? ?PR bootstrap/41451
> ? ? ? ?* fold-const.c (fold_binary_loc): Do not call
> ? ? ? ?protected_set_expr_location.
>
> Index: fold-const.c
> ===================================================================
> --- fold-const.c ? ? ? ?(revision 153549)
> +++ fold-const.c ? ? ? ?(working copy)
> @@ -10134,7 +10134,6 @@ fold_binary_loc (location_t loc,
> ? ? ? ? ?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);
> ? ? ? ? ?tem = build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0), tem);
> ? ? ? ? ?goto fold_binary_exit;
> ? ? ? ?}
> @@ -10144,7 +10143,6 @@ fold_binary_loc (location_t loc,
> ? ? ? ? ?tem = fold_build2_loc (loc, code, type, op0,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? fold_convert_loc (loc, TREE_TYPE (op1),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TREE_OPERAND (arg1, 1)));
> - ? ? ? ? protected_set_expr_location (tem, loc);
> ? ? ? ? ?tem = build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0), tem);
> ? ? ? ? ?goto fold_binary_exit;
> ? ? ? ?}
>


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