> 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?

        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;
        }

Reply via email to