+2003-05-13 Jason Merrill <jason@redhat.com>
+
+ * typeck.c (build_modify_expr): Don't always stabilize the lhs and
+ rhs. Do stabilize the lhs of a MODIFY_EXPR used on the lhs.
+
2003-05-11 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
* method.c (synthesize_method): Call push/pop_deferring_access_checks.
TREE_OPERAND (lhs, 0), newrhs);
case MODIFY_EXPR:
+ if (TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0)))
+ lhs = build (TREE_CODE (lhs), TREE_TYPE (lhs),
+ stabilize_reference (TREE_OPERAND (lhs, 0)),
+ TREE_OPERAND (lhs, 1));
newrhs = build_modify_expr (TREE_OPERAND (lhs, 0), modifycode, rhs);
if (newrhs == error_mark_node)
return error_mark_node;
}
}
- if (TREE_CODE (lhstype) != REFERENCE_TYPE)
- {
- if (TREE_SIDE_EFFECTS (lhs))
- lhs = stabilize_reference (lhs);
- if (TREE_SIDE_EFFECTS (newrhs))
- newrhs = stabilize_reference (newrhs);
- }
-
/* Convert new value to destination type. */
if (TREE_CODE (lhstype) == ARRAY_TYPE)