summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 17:05:35 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 17:05:35 +0000
commite62f1d3ac988062027deeb5373bb4d504add34e8 (patch)
treed7d118b337f71166a7b587512eb123dafdf47ce6 /gcc
parent5983a5c781de3a2fb99b8f750763a8eb0d0ba995 (diff)
downloadppe42-gcc-e62f1d3ac988062027deeb5373bb4d504add34e8.tar.gz
ppe42-gcc-e62f1d3ac988062027deeb5373bb4d504add34e8.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66766 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck.c12
2 files changed, 9 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8e19ceec6cd..f375a4f8205 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 20e602a883e..833d169a101 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -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)
OpenPOWER on IntegriCloud