tree.c (build1): Set TREE_SIDE_EFFECTS for expressions that always have side-effects.
authorRichard Henderson <rth@gcc.gnu.org>
Mon, 4 Oct 1999 23:57:47 +0000 (16:57 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 4 Oct 1999 23:57:47 +0000 (16:57 -0700)
        * tree.c (build1): Set TREE_SIDE_EFFECTS for expressions that
        always have side-effects.  Use memset not bzero.
        (make_node): Likewise.

From-SVN: r29817

gcc/ChangeLog
gcc/tree.c

index a03ab5d..a8a2734 100644 (file)
@@ -1,3 +1,9 @@
+Mon Oct  4 16:56:11 1999  Richard Henderson  <rth@cygnus.com>
+
+       * tree.c (build1): Set TREE_SIDE_EFFECTS for expressions that
+       always have side-effects.  Use memset not bzero.
+       (make_node): Likewise.
+
 Mon Oct  4 16:22:20 1999  Mark Mitchell  <mark@codesourcery.com>
 
        * stmt.c (expand_anon_union_decl): When any of the elements of the
@@ -36,7 +42,7 @@ Mon Oct  4 02:31:20 1999  Mark Mitchell  <mark@codesourcery.com>
 Mon Oct  4 02:12:41 1999  Mark Mitchell  <mark@codesourcery.com>
 
        * tree.c (make_node): Set TREE_SIDE_EFFECTS for expressions that
-       are always have side-effects.
+       always have side-effects.
 
 Sun Oct  3 14:14:16 1999  Jeffrey A Law  (law@cygnus.com)
 
index 221afba..8f70747 100644 (file)
@@ -1028,7 +1028,7 @@ make_node (code)
   else
     {
       t = (tree) obstack_alloc (obstack, length);
-      bzero ((PTR) t, length);
+      memset ((PTR) t, 0, length);
     }
 
 #ifdef GATHER_STATISTICS
@@ -3115,8 +3115,10 @@ build1 (code, type, node)
   if (ggc_p)
     t = ggc_alloc_tree (length);
   else
-    t = (tree) obstack_alloc (obstack, length);
-  bzero ((PTR) t, length);
+    {
+      t = (tree) obstack_alloc (obstack, length);
+      memset ((PTR) t, 0, length);
+    }
 
 #ifdef GATHER_STATISTICS
   tree_node_counts[(int)kind]++;
@@ -3138,6 +3140,25 @@ build1 (code, type, node)
        TREE_RAISES (t) = 1;
     }
 
+  switch (code)
+    {
+    case INIT_EXPR:
+    case MODIFY_EXPR:
+    case VA_ARG_EXPR:
+    case RTL_EXPR:
+    case PREDECREMENT_EXPR:
+    case PREINCREMENT_EXPR:
+    case POSTDECREMENT_EXPR:
+    case POSTINCREMENT_EXPR:
+      /* All of these have side-effects, no matter what their
+        operands are.  */
+      TREE_SIDE_EFFECTS (t) = 1;
+      break;
+         
+    default:
+      break;
+    }
+
   return t;
 }