typeck.c (build_modify_expr): Don't always stabilize the lhs and rhs.

* 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.

From-SVN: r66766
This commit is contained in:
Jason Merrill 2003-05-13 13:05:35 -04:00 committed by Jason Merrill
parent ec86c71f91
commit a65cddcf39
2 changed files with 9 additions and 8 deletions

View File

@ -1,3 +1,8 @@
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.

View File

@ -5336,6 +5336,10 @@ build_modify_expr (lhs, modifycode, rhs)
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;
@ -5541,14 +5545,6 @@ build_modify_expr (lhs, modifycode, rhs)
}
}
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)