* c-common.c (verify_tree): Don't check code length if we know
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Dec 2004 06:39:00 +0000 (06:39 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Dec 2004 06:39:00 +0000 (06:39 +0000)
we are handling tcc_unary.
* print_tree.c (print_node): Remove code to handle RTL
appearing as a part of a tree node.
* tree-gimple.c (recalculate_side_effects): Rename fro as len.
* tree.c (build1_stat): Don't check TREE_CODE_LENGTH.
(PROCESS_ARG): Don't refer to fro.
(build2_stat, build3_stat, build4_stat): Don't compute fro.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91855 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-common.c
gcc/print-tree.c
gcc/tree-gimple.c
gcc/tree.c

index b03f62a..9c03269 100644 (file)
@@ -1,3 +1,14 @@
+2004-12-08  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * c-common.c (verify_tree): Don't check code length if we know
+       we are handling tcc_unary.
+       * print_tree.c (print_node): Remove code to handle RTL
+       appearing as a part of a tree node.
+       * tree-gimple.c (recalculate_side_effects): Rename fro as len.
+       * tree.c (build1_stat): Don't check TREE_CODE_LENGTH.
+       (PROCESS_ARG): Don't refer to fro.
+       (build2_stat, build3_stat, build4_stat): Don't compute fro.
+
 2004-12-07  Roger Sayle  <roger@eyesopen.com>
 
        PR middle-end/18293
index 627911d..a6f303b 100644 (file)
@@ -1365,8 +1365,6 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp,
         Other non-expressions need not be processed.  */
       if (cl == tcc_unary)
        {
-         if (TREE_CODE_LENGTH (code) == 0)
-           return;
          x = TREE_OPERAND (x, 0);
          writer = 0;
          goto restart;
index f47d21a..caba377 100644 (file)
@@ -158,7 +158,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
   enum machine_mode mode;
   enum tree_code_class class;
   int len;
-  int first_rtl;
   int i;
   expanded_location xloc;
 
@@ -591,29 +590,12 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
 
       len = TREE_CODE_LENGTH (TREE_CODE (node));
 
-      /* Some nodes contain rtx's, not trees,
-        after a certain point.  Print the rtx's as rtx's.  */
-      first_rtl = TREE_CODE_LENGTH (TREE_CODE (node));
-
       for (i = 0; i < len; i++)
        {
-         if (i >= first_rtl)
-           {
-             indent_to (file, indent + 4);
-             fprintf (file, "rtl %d ", i);
-             if (TREE_OPERAND (node, i))
-               print_rtl (file, (rtx) TREE_OPERAND (node, i));
-             else
-               fprintf (file, "(nil)");
-             fprintf (file, "\n");
-           }
-         else
-           {
-             char temp[10];
+         char temp[10];
 
-             sprintf (temp, "arg %d", i);
-             print_node (file, temp, TREE_OPERAND (node, i), indent + 4);
-           }
+         sprintf (temp, "arg %d", i);
+         print_node (file, temp, TREE_OPERAND (node, i), indent + 4);
        }
 
       print_node (file, "chain", TREE_CHAIN (node), indent + 4);
index e1cbc33..0253676 100644 (file)
@@ -443,7 +443,7 @@ void
 recalculate_side_effects (tree t)
 {
   enum tree_code code = TREE_CODE (t);
-  int fro = TREE_CODE_LENGTH (code);
+  int len = TREE_CODE_LENGTH (code);
   int i;
 
   switch (TREE_CODE_CLASS (code))
@@ -472,7 +472,7 @@ recalculate_side_effects (tree t)
     case tcc_binary:      /* a binary arithmetic expression */
     case tcc_reference:   /* a reference */
       TREE_SIDE_EFFECTS (t) = TREE_THIS_VOLATILE (t);
-      for (i = 0; i < fro; ++i)
+      for (i = 0; i < len; ++i)
        {
          tree op = TREE_OPERAND (t, i);
          if (op && TREE_SIDE_EFFECTS (op))
index 0ff686c..0b41c71 100644 (file)
@@ -2495,7 +2495,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
   TREE_COMPLEXITY (t) = 0;
   TREE_OPERAND (t, 0) = node;
   TREE_BLOCK (t) = NULL_TREE;
-  if (node && !TYPE_P (node) && TREE_CODE_LENGTH (code) != 0)
+  if (node && !TYPE_P (node))
     {
       TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (node);
       TREE_READONLY (t) = TREE_READONLY (node);
@@ -2551,7 +2551,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
 #define PROCESS_ARG(N)                 \
   do {                                 \
     TREE_OPERAND (t, N) = arg##N;      \
-    if (arg##N &&!TYPE_P (arg##N) && fro > N) \
+    if (arg##N &&!TYPE_P (arg##N))     \
       {                                        \
         if (TREE_SIDE_EFFECTS (arg##N))        \
          side_effects = 1;             \
@@ -2569,7 +2569,6 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
 {
   bool constant, read_only, side_effects, invariant;
   tree t;
-  int fro;
 
   gcc_assert (TREE_CODE_LENGTH (code) == 2);
 
@@ -2580,7 +2579,6 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
      result based on those same flags for the arguments.  But if the
      arguments aren't really even `tree' expressions, we shouldn't be trying
      to do this.  */
-  fro = TREE_CODE_LENGTH (code);
 
   /* Expressions without side effects may be constant if their
      arguments are as well.  */
@@ -2610,15 +2608,12 @@ build3_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
 {
   bool constant, read_only, side_effects, invariant;
   tree t;
-  int fro;
 
   gcc_assert (TREE_CODE_LENGTH (code) == 3);
 
   t = make_node_stat (code PASS_MEM_STAT);
   TREE_TYPE (t) = tt;
 
-  fro = TREE_CODE_LENGTH (code);
-
   side_effects = TREE_SIDE_EFFECTS (t);
 
   PROCESS_ARG(0);
@@ -2659,15 +2654,12 @@ build4_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
 {
   bool constant, read_only, side_effects, invariant;
   tree t;
-  int fro;
 
   gcc_assert (TREE_CODE_LENGTH (code) == 4);
 
   t = make_node_stat (code PASS_MEM_STAT);
   TREE_TYPE (t) = tt;
 
-  fro = TREE_CODE_LENGTH (code);
-
   side_effects = TREE_SIDE_EFFECTS (t);
 
   PROCESS_ARG(0);