aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-08-17 04:32:09 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-08-17 04:32:09 +0000
commit9a52d09b746d955ce42815329962db3bb19b4d18 (patch)
tree82671172fd99ac690ae6faffbed4dd4b9bae1fe0 /gcc
parent715bdd29f333820829fa846ea8302b8e540b88f2 (diff)
downloadgcc-9a52d09b746d955ce42815329962db3bb19b4d18.zip
gcc-9a52d09b746d955ce42815329962db3bb19b4d18.tar.gz
gcc-9a52d09b746d955ce42815329962db3bb19b4d18.tar.bz2
cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS on COMPOUND_EXPRs.
* cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS on COMPOUND_EXPRs. From-SVN: r44956
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/cvt.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e50446c..441735e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-16 Mark Mitchell <mark@codesourcery.com>
+
+ * cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS
+ on COMPOUND_EXPRs.
+
2001-08-14 Richard Henderson <rth@redhat.com>
* class.c, cp-tree.h (build_vfn_ref): Remove.
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 5b153ef..f8845b2 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -950,8 +950,13 @@ convert_to_void (expr, implicit)
tree new_op1 = convert_to_void (op1, implicit);
if (new_op1 != op1)
- expr = build (COMPOUND_EXPR, TREE_TYPE (new_op1),
- TREE_OPERAND (expr, 0), new_op1);
+ {
+ tree t = build (COMPOUND_EXPR, TREE_TYPE (new_op1),
+ TREE_OPERAND (expr, 0), new_op1);
+ TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (expr);
+ expr = t;
+ }
+
break;
}