cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS on COMPOUND_EXPRs.
authorMark Mitchell <mark@codesourcery.com>
Fri, 17 Aug 2001 04:32:09 +0000 (04:32 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 17 Aug 2001 04:32:09 +0000 (04:32 +0000)
* cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS
on COMPOUND_EXPRs.

From-SVN: r44956

gcc/cp/ChangeLog
gcc/cp/cvt.c

index e50446cb0e0731510278cc771d65db046ea2bd8c..441735e7cc9f689a04dd037671fdf004f86ea916 100644 (file)
@@ -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.
index 5b153efff179de24a9f42680dfb436188f16a47c..f8845b29d7fd44bbf1787f52199b19fc54e4c8f1 100644 (file)
@@ -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;
       }