@@ -7211,7 +7211,10 @@ convert_for_assignment (tree type, tree
if (TREE_CODE (type) == VECTOR_TYPE && coder == VECTOR_TYPE
&& vector_types_convertible_p (type, rhstype, true))
- return convert (type, rhs);
+ {
+ rhs = mark_rvalue_use (rhs);
+ return convert (type, rhs);
+ }
if (rhs == error_mark_node || rhstype == error_mark_node)
return error_mark_node;
@@ -7255,7 +7258,10 @@ convert_for_assignment (tree type, tree
}
if (objc_compare_types (type, rhstype, parmno, rname))
- return convert (type, rhs);
+ {
+ rhs = mark_rvalue_use (rhs);
+ return convert (type, rhs);
+ }
}
/* [expr.ass]
@@ -1478,8 +1478,8 @@ build_m_component_ref (tree datum, tree
if (error_operand_p (datum) || error_operand_p (component))
return error_mark_node;
- mark_lvalue_use (datum);
- mark_rvalue_use (component);
+ datum = mark_lvalue_use (datum);
+ component = mark_rvalue_use (component);
ptrmem_type = TREE_TYPE (component);
if (!TYPE_PTR_TO_MEMBER_P (ptrmem_type))
@@ -284,7 +284,7 @@ build_base_path (enum tree_code code,
/* This must happen before the call to save_expr. */
expr = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error);
else
- mark_rvalue_use (expr);
+ expr = mark_rvalue_use (expr);
offset = BINFO_OFFSET (binfo);
fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull);
@@ -3861,8 +3861,8 @@ build_conditional_expr (tree arg1, tree
&& same_type_p (arg2_type, arg3_type))
{
result_type = arg2_type;
- mark_lvalue_use (arg2);
- mark_lvalue_use (arg3);
+ arg2 = mark_lvalue_use (arg2);
+ arg3 = mark_lvalue_use (arg3);
goto valid_operands;
}
@@ -0,0 +1,25 @@
+/* PR c++/44780 */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+typedef double vec __attribute__ ((__vector_size__ (16)));
+vec c, d;
+
+void
+foo (void)
+{
+ vec a;
+ vec b;
+ a = c;
+ b = a;
+ d = b;
+}
+
+void
+bar (void)
+{
+ vec a;
+ vec b; /* { dg-warning "set but not used" } */
+ a = c;
+ b = a;
+}