OSDN Git Service

* config/s390/s390.c (s390_fixup_clobbered_return_reg):
[pf3gnuchains/gcc-fork.git] / gcc / tree.c
index f2fc48f..8cb27aa 100644 (file)
@@ -136,8 +136,8 @@ void
 init_ttree ()
 {
   /* Initialize the hash table of types.  */
-  type_hash_table = htab_create (TYPE_HASH_INITIAL_SIZE, type_hash_hash,
-                                type_hash_eq, 0);
+  type_hash_table = htab_create_ggc (TYPE_HASH_INITIAL_SIZE, type_hash_hash,
+                                    type_hash_eq, 0);
 }
 
 \f
@@ -1070,7 +1070,7 @@ build_tree_list (parm, value)
 }
 
 /* Return a newly created TREE_LIST node whose
-   purpose and value fields are PARM and VALUE
+   purpose and value fields are PURPOSE and VALUE
    and whose TREE_CHAIN is CHAIN.  */
 
 tree
@@ -1362,7 +1362,7 @@ save_expr (expr)
   /* If we have simple operations applied to a SAVE_EXPR or to a SAVE_EXPR and
      a constant, it will be more efficient to not make another SAVE_EXPR since
      it will allow better simplification and GCSE will be able to merge the
-     computations if they actualy occur.  */
+     computations if they actually occur.  */
   inner = t;
   while (1)
     {
@@ -1890,8 +1890,13 @@ substitute_in_expr (exp, f, r)
          else if (code == CONSTRUCTOR)
            abort ();
 
-         op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r);
-         op1 = substitute_in_expr (TREE_OPERAND (exp, 1), f, r);
+         op0 = TREE_OPERAND (exp, 0);
+         op1 = TREE_OPERAND (exp, 1);
+         if (contains_placeholder_p (op0))
+           op0 = substitute_in_expr (op0, f, r);
+         if (contains_placeholder_p (op1))
+           op1 = substitute_in_expr (op1, f, r);
+
          if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1))
            return exp;
 
@@ -1917,9 +1922,17 @@ substitute_in_expr (exp, f, r)
          else if (code != COND_EXPR)
            abort ();
 
-         op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r);
-         op1 = substitute_in_expr (TREE_OPERAND (exp, 1), f, r);
-         op2 = substitute_in_expr (TREE_OPERAND (exp, 2), f, r);
+         op0 = TREE_OPERAND (exp, 0);
+         op1 = TREE_OPERAND (exp, 1);
+         op2 = TREE_OPERAND (exp, 2);
+
+         if (contains_placeholder_p (op0))
+           op0 = substitute_in_expr (op0, f, r);
+         if (contains_placeholder_p (op1))
+           op1 = substitute_in_expr (op1, f, r);
+         if (contains_placeholder_p (op2))
+           op2 = substitute_in_expr (op2, f, r);
+
          if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1)
              && op2 == TREE_OPERAND (exp, 2))
            return exp;
@@ -3958,10 +3971,10 @@ get_narrower (op, unsignedp_ptr)
 
       /* See what's inside this conversion.  If we decide to strip it,
         we will set WIN.  */
-      op = TREE_OPERAND (op, 0);
 
       if (bitschange > 0)
        {
+         op = TREE_OPERAND (op, 0);
          /* An extension: the outermost one can be stripped,
             but remember whether it is zero or sign extension.  */
          if (first)
@@ -3980,6 +3993,7 @@ get_narrower (op, unsignedp_ptr)
          if (first)
            uns = TREE_UNSIGNED (TREE_TYPE (op));
          first = 0;
+         op = TREE_OPERAND (op, 0);
        }
 
       win = op;