2010-02-15 Christian Bruel <christian.bruel@st.com>
* gcc/c-common.c (c_fully_fold_internal): Don't create a new NOP expr.
* gcc/fold-const.c (try_move_mult_to_index): assert CAN_HAVE_LOCATION_P.
(fold_comparison): Likewise.
* gcc/tree.c (build_case_label): Likewise.
===================================================================
@@ -1435,12 +1435,9 @@
have been done by this point, so remove them again. */
nowarning |= TREE_NO_WARNING (ret);
STRIP_TYPE_NOPS (ret);
- if (nowarning && !TREE_NO_WARNING (ret))
- {
- if (!CAN_HAVE_LOCATION_P (ret))
- ret = build1 (NOP_EXPR, TREE_TYPE (ret), ret);
- TREE_NO_WARNING (ret) = 1;
- }
+ if (nowarning)
+ TREE_NO_WARNING (ret) = 1;
+
if (ret != expr)
protected_set_expr_location (ret, loc);
return ret;
===================================================================
@@ -1678,6 +1678,7 @@
tree t = make_node (CASE_LABEL_EXPR);
TREE_TYPE (t) = void_type_node;
+ gcc_assert (CAN_HAVE_LOCATION_P (t));
SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (label_decl));
CASE_LOW (t) = low_value;
===================================================================
@@ -6972,6 +6972,7 @@
pref = TREE_OPERAND (addr, 0);
ret = copy_node (pref);
+ gcc_assert (CAN_HAVE_LOCATION_P (ret));
SET_EXPR_LOCATION (ret, loc);
pos = ret;
@@ -9427,6 +9428,7 @@
if (save_p)
{
tem = save_expr (build2 (code, type, cval1, cval2));
+ gcc_assert (CAN_HAVE_LOCATION_P (tem));
SET_EXPR_LOCATION (tem, loc);
return tem;
}