OSDN Git Service

In include:
[pf3gnuchains/gcc-fork.git] / gcc / tree.c
index 2a0ed56..e1a4a7d 100644 (file)
@@ -19,7 +19,6 @@ along with GNU CC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-
 /* This file contains the low level primitives for operating on tree nodes,
    including allocation, list operations, interning of identifiers,
    construction of data type nodes and statement nodes,
@@ -48,7 +47,7 @@ Boston, MA 02111-1307, USA.  */
 
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
-/* obstack.[ch] explicitly declined to prototype this. */
+/* obstack.[ch] explicitly declined to prototype this.  */
 extern int _obstack_allocated_p PARAMS ((struct obstack *h, PTR obj));
 
 static void unsave_expr_now_r PARAMS ((tree));
@@ -146,7 +145,7 @@ char *momentary_function_firstobj;
 int all_types_permanent;
 
 /* Stack of places to restore the momentary obstack back to.  */
-   
+
 struct momentary_level
 {
   /* Pointer back to previous such level.  */
@@ -211,8 +210,8 @@ typedef enum
   all_kinds
 } tree_node_kind;
 
-int tree_node_counts[(int)all_kinds];
-int tree_node_sizes[(int)all_kinds];
+int tree_node_counts[(int) all_kinds];
+int tree_node_sizes[(int) all_kinds];
 int id_string_size = 0;
 
 static const char * const tree_node_kind_names[] = {
@@ -246,10 +245,6 @@ static int next_decl_uid;
 /* Unique id for next type created.  */
 static int next_type_uid = 1;
 
-/* The language-specific function for alias analysis.  If NULL, the
-   language does not do any special alias analysis.  */
-int (*lang_get_alias_set) PARAMS ((tree));
-
 /* Here is how primitive or already-canonicalized types' hash
    codes are made.  */
 #define TYPE_HASH(TYPE) ((unsigned long) (TYPE) & 0777777)
@@ -263,7 +258,7 @@ struct type_hash
   tree type;
 };
 
-/* Initial size of the hash table (rounded to next prime). */
+/* Initial size of the hash table (rounded to next prime).  */
 #define TYPE_HASH_INITIAL_SIZE 1000
 
 /* Now here is the hash table.  When recording a type, it is added to
@@ -283,6 +278,7 @@ static int type_hash_eq PARAMS ((const void*, const void*));
 static unsigned int type_hash_hash PARAMS ((const void*));
 static void print_type_hash_statistics PARAMS((void));
 static int mark_hash_entry PARAMS((void **, void *));
+static void finish_vector_type PARAMS((tree));
 
 /* If non-null, these are language-specific helper functions for
    unsave_expr_now.  If present, LANG_UNSAVE is called before its
@@ -332,7 +328,7 @@ init_obstacks ()
   ggc_add_tree_root (hash_table, sizeof hash_table / sizeof (tree));
 
   /* Initialize the hash table of types.  */
-  type_hash_table = htab_create (TYPE_HASH_INITIAL_SIZE, type_hash_hash, 
+  type_hash_table = htab_create (TYPE_HASH_INITIAL_SIZE, type_hash_hash,
                                 type_hash_eq, 0);
   ggc_add_root (&type_hash_table, 1, sizeof type_hash_table, mark_type_hash);
   ggc_add_tree_root (global_trees, TI_MAX);
@@ -525,7 +521,7 @@ void
 push_obstacks_nochange ()
 {
   struct obstack_stack *p;
-  
+
   p = (struct obstack_stack *) obstack_alloc (&obstack_stack_obstack,
                                              (sizeof (struct obstack_stack)));
 
@@ -937,7 +933,7 @@ make_node (code)
         PARM_DECLs of top-level functions do not have this problem.  However,
         we allocate them where we put the FUNCTION_DECL for languages such as
         Ada that need to consult some flags in the PARM_DECLs of the function
-        when calling it. 
+        when calling it.
 
         See comment in restore_tree_status for why we can't put this
         in function_obstack.  */
@@ -996,7 +992,7 @@ make_node (code)
       if (code == BIND_EXPR && obstack != &permanent_obstack)
        obstack = saveable_obstack;
       length = sizeof (struct tree_exp)
-       + (tree_code_length[(int) code] - 1) * sizeof (char *);
+       + (TREE_CODE_LENGTH (code) - 1) * sizeof (char *);
       break;
 
     case 'c':  /* a constant */
@@ -1005,7 +1001,7 @@ make_node (code)
 #endif
       obstack = expression_obstack;
 
-      /* We can't use tree_code_length for INTEGER_CST, since the number of
+      /* We can't use TREE_CODE_LENGTH for INTEGER_CST, since the number of
         words is machine-dependent due to varying length of HOST_WIDE_INT,
         which might be wider than a pointer (e.g., long long).  Similarly
         for REAL_CST, since the number of words is machine-dependent due
@@ -1017,7 +1013,7 @@ make_node (code)
        length = sizeof (struct tree_real_cst);
       else
        length = sizeof (struct tree_common)
-         + tree_code_length[(int) code] * sizeof (char *);
+         + TREE_CODE_LENGTH (code) * sizeof (char *);
       break;
 
     case 'x':  /* something random, like an identifier.  */
@@ -1032,7 +1028,7 @@ make_node (code)
        kind = x_kind;
 #endif
       length = sizeof (struct tree_common)
-       + tree_code_length[(int) code] * sizeof (char *);
+       + TREE_CODE_LENGTH (code) * sizeof (char *);
       /* Identifier nodes are always permanent since they are
         unique in a compiler run.  */
       if (code == IDENTIFIER_NODE) obstack = &permanent_obstack;
@@ -1045,14 +1041,13 @@ make_node (code)
   if (ggc_p)
     t = ggc_alloc_tree (length);
   else
-    {
-      t = (tree) obstack_alloc (obstack, length);
-      memset ((PTR) t, 0, length);
-    }
+    t = (tree) obstack_alloc (obstack, length);
+
+  memset ((PTR) t, 0, length);
 
 #ifdef GATHER_STATISTICS
-  tree_node_counts[(int)kind]++;
-  tree_node_sizes[(int)kind] += length;
+  tree_node_counts[(int) kind]++;
+  tree_node_sizes[(int) kind] += length;
 #endif
 
   TREE_SET_CODE (t, code);
@@ -1068,9 +1063,10 @@ make_node (code)
     case 'd':
       if (code != FUNCTION_DECL)
        DECL_ALIGN (t) = 1;
+      DECL_USER_ALIGN (t) = 0;
       DECL_IN_SYSTEM_HEADER (t) = in_system_header;
       DECL_SOURCE_LINE (t) = lineno;
-      DECL_SOURCE_FILE (t) = 
+      DECL_SOURCE_FILE (t) =
        (input_filename) ? input_filename : built_in_filename;
       DECL_UID (t) = next_decl_uid++;
       /* Note that we have not yet computed the alias set for this
@@ -1081,6 +1077,7 @@ make_node (code)
     case 't':
       TYPE_UID (t) = next_type_uid++;
       TYPE_ALIGN (t) = 1;
+      TYPE_USER_ALIGN (t) = 0;
       TYPE_MAIN_VARIANT (t) = t;
       TYPE_OBSTACK (t) = obstack;
       TYPE_ATTRIBUTES (t) = NULL_TREE;
@@ -1111,7 +1108,7 @@ make_node (code)
             operands are.  */
          TREE_SIDE_EFFECTS (t) = 1;
          break;
-         
+
        default:
          break;
        }
@@ -1129,7 +1126,7 @@ tree (*make_lang_type_fn) PARAMS ((enum tree_code)) = make_node;
 /* Return a new type (with the indicated CODE), doing whatever
    language-specific processing is required.  */
 
-tree 
+tree
 make_lang_type (code)
      enum tree_code code;
 {
@@ -1171,11 +1168,11 @@ copy_node (node)
     case '1':  /* a unary arithmetic expression */
     case '2':  /* a binary arithmetic expression */
       length = sizeof (struct tree_exp)
-       + (tree_code_length[(int) code] - 1) * sizeof (char *);
+       + (TREE_CODE_LENGTH (code) - 1) * sizeof (char *);
       break;
 
     case 'c':  /* a constant */
-      /* We can't use tree_code_length for INTEGER_CST, since the number of
+      /* We can't use TREE_CODE_LENGTH for INTEGER_CST, since the number of
         words is machine-dependent due to varying length of HOST_WIDE_INT,
         which might be wider than a pointer (e.g., long long).  Similarly
         for REAL_CST, since the number of words is machine-dependent due
@@ -1186,12 +1183,12 @@ copy_node (node)
        length = sizeof (struct tree_real_cst);
       else
        length = (sizeof (struct tree_common)
-                 + tree_code_length[(int) code] * sizeof (char *));
+                 + TREE_CODE_LENGTH (code) * sizeof (char *));
       break;
 
     case 'x':  /* something random, like an identifier.  */
       length = sizeof (struct tree_common)
-       + tree_code_length[(int) code] * sizeof (char *);
+       + TREE_CODE_LENGTH (code) * sizeof (char *);
       if (code == TREE_VEC)
        length += (TREE_VEC_LENGTH (node) - 1) * sizeof (char *);
     }
@@ -1280,15 +1277,16 @@ get_identifier (text)
 
   hi &= (1 << HASHBITS) - 1;
   hi %= MAX_HASH_TABLE;
-  
-  /* Search table for identifier */
+
+  /* Search table for identifier */
   for (idp = hash_table[hi]; idp; idp = TREE_CHAIN (idp))
     if (IDENTIFIER_LENGTH (idp) == len
        && IDENTIFIER_POINTER (idp)[0] == text[0]
        && !bcmp (IDENTIFIER_POINTER (idp), text, len))
-      return idp;              /* <-- return if found */
+      /* Return if found.  */
+      return idp;
 
-  /* Not found; optionally warn about a similar identifier */
+  /* Not found; optionally warn about a similar identifier */
   if (warn_id_clash && do_identifier_warnings && len >= id_clash_len)
     for (idp = hash_table[hi]; idp; idp = TREE_CHAIN (idp))
       if (!strncmp (IDENTIFIER_POINTER (idp), text, id_clash_len))
@@ -1298,7 +1296,7 @@ get_identifier (text)
          break;
        }
 
-  if (tree_code_length[(int) IDENTIFIER_NODE] < 0)
+  if (TREE_CODE_LENGTH (IDENTIFIER_NODE) < 0)
     abort ();                  /* set_identifier_size hasn't been called.  */
 
   /* Not found, create one, add to chain */
@@ -1346,8 +1344,8 @@ maybe_get_identifier (text)
 
   hi &= (1 << HASHBITS) - 1;
   hi %= MAX_HASH_TABLE;
-  
-  /* Search table for identifier */
+
+  /* Search table for identifier */
   for (idp = hash_table[hi]; idp; idp = TREE_CHAIN (idp))
     if (IDENTIFIER_LENGTH (idp) == len
        && IDENTIFIER_POINTER (idp)[0] == text[0]
@@ -1381,7 +1379,7 @@ set_identifier_size (size)
 \f
 /* Return a newly constructed INTEGER_CST node whose constant value
    is specified by the two ints LOW and HI.
-   The TREE_TYPE is set to `int'. 
+   The TREE_TYPE is set to `int'.
 
    This function should be used via the `build_int_2' macro.  */
 
@@ -1450,11 +1448,11 @@ real_value_from_int_cst (type, i)
     {
       REAL_VALUE_TYPE e;
 
-      d = (double) (~ TREE_INT_CST_HIGH (i));
+      d = (double) (~TREE_INT_CST_HIGH (i));
       e = ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2))
            * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)));
       d *= e;
-      e = (double) (~ TREE_INT_CST_LOW (i));
+      e = (double) (~TREE_INT_CST_LOW (i));
       d += e;
       d = (- d - 1.0);
     }
@@ -1464,7 +1462,7 @@ real_value_from_int_cst (type, i)
 
       d = (double) (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (i);
       e = ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2))
-           * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)));
+          * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)));
       d *= e;
       e = (double) TREE_INT_CST_LOW (i);
       d += e;
@@ -1477,9 +1475,9 @@ real_value_from_int_cst (type, i)
 
 struct brfic_args
 {
-  tree type;                   /* Input: type to conver to. */
-  tree i;                      /* Input: operand to convert */
-  REAL_VALUE_TYPE d;           /* Output: floating point value. */
+  tree type;                   /* Input: type to conver to.  */
+  tree i;                      /* Input: operand to convert */
+  REAL_VALUE_TYPE d;           /* Output: floating point value.  */
 };
 
 /* Convert an integer to a floating point value while protected by a floating
@@ -1487,10 +1485,10 @@ struct brfic_args
 
 static void
 build_real_from_int_cst_1 (data)
-  PTR data;
+     PTR data;
 {
   struct brfic_args *args = (struct brfic_args *) data;
-  
+
 #ifdef REAL_ARITHMETIC
   args->d = real_value_from_int_cst (args->type, args->i);
 #else
@@ -1531,7 +1529,7 @@ build_real_from_int_cst (type, i)
       d = dconst0;
       overflow = 1;
     }
-  
+
   /* Check for valid float value for this type on this target machine.  */
 
 #ifdef CHECK_FLOAT_VALUE
@@ -1608,11 +1606,9 @@ make_tree_vec (len)
   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);
   TREE_SET_CODE (t, TREE_VEC);
   TREE_VEC_LENGTH (t) = len;
   TREE_SET_PERMANENT (t);
@@ -1679,7 +1675,7 @@ integer_all_onesp (expr)
 
   uns = TREE_UNSIGNED (TREE_TYPE (expr));
   if (!uns)
-    return (TREE_INT_CST_LOW (expr) == ~ (unsigned HOST_WIDE_INT) 0
+    return (TREE_INT_CST_LOW (expr) == ~(unsigned HOST_WIDE_INT) 0
            && TREE_INT_CST_HIGH (expr) == -1);
 
   /* Note that using TYPE_PRECISION here is wrong.  We care about the
@@ -1702,7 +1698,7 @@ integer_all_onesp (expr)
       else
        high_value = ((HOST_WIDE_INT) 1 << shift_amount) - 1;
 
-      return (TREE_INT_CST_LOW (expr) == ~ (unsigned HOST_WIDE_INT) 0
+      return (TREE_INT_CST_LOW (expr) == ~(unsigned HOST_WIDE_INT) 0
              && TREE_INT_CST_HIGH (expr) == high_value);
     }
   else
@@ -1791,7 +1787,7 @@ tree_log2 (expr)
     }
 
   return (high != 0 ? HOST_BITS_PER_WIDE_INT + exact_log2 (high)
-         :  exact_log2 (low));
+         : exact_log2 (low));
 }
 
 /* Similar, but return the largest integer Y such that 2 ** Y is less
@@ -1883,7 +1879,7 @@ real_twop (expr)
 }
 
 /* Nonzero if EXP is a constant or a cast of a constant.  */
+
 int
 really_constant_p (exp)
      tree exp;
@@ -2054,7 +2050,8 @@ chainon (op1, op2)
 #endif
       return op1;
     }
-  else return op2;
+  else
+    return op2;
 }
 
 /* Return the last node in a chain of nodes (chained through TREE_CHAIN).  */
@@ -2168,10 +2165,9 @@ tree_cons (purpose, value, chain)
   if (ggc_p)
     node = ggc_alloc_tree (sizeof (struct tree_list));
   else
-    {
-      node = (tree) obstack_alloc (current_obstack, sizeof (struct tree_list));
-      memset (node, 0, sizeof (struct tree_common));
-    }
+    node = (tree) obstack_alloc (current_obstack, sizeof (struct tree_list));
+
+  memset (node, 0, sizeof (struct tree_common));
 
 #ifdef GATHER_STATISTICS
   tree_node_counts[(int) x_kind]++;
@@ -2521,7 +2517,7 @@ save_expr (expr)
   /* If the tree evaluates to a constant, then we don't want to hide that
      fact (i.e. this allows further folding, and direct checks for constants).
      However, a read-only object that has side effects cannot be bypassed.
-     Since it is no problem to reevaluate literals, we just return the 
+     Since it is no problem to reevaluate literals, we just return the
      literal node.  */
 
   if (TREE_CONSTANT (t) || (TREE_READONLY (t) && ! TREE_SIDE_EFFECTS (t))
@@ -2590,7 +2586,7 @@ first_rtl_op (code)
     case METHOD_CALL_EXPR:
       return 3;
     default:
-      return tree_code_length [(int) code];
+      return TREE_CODE_LENGTH (code);
     }
 }
 
@@ -2619,7 +2615,7 @@ unsave_expr_1 (expr)
       TREE_OPERAND (expr, 1) = TREE_OPERAND (expr, 3);
       TREE_OPERAND (expr, 3) = NULL_TREE;
       break;
-      
+
     case RTL_EXPR:
       /* I don't yet know how to emit a sequence multiple times.  */
       if (RTL_EXPR_SEQUENCE (expr) != 0)
@@ -2676,7 +2672,7 @@ unsave_expr_now_r (expr)
     case '1':  /* a unary arithmetic expression */
       {
        int i;
-       
+
        for (i = first_rtl_op (code) - 1; i >= 0; i--)
          unsave_expr_now_r (TREE_OPERAND (expr, i));
       }
@@ -2704,7 +2700,7 @@ unsave_expr_now (expr)
 
 /* Return 0 if it is safe to evaluate EXPR multiple times,
    return 1 if it is safe if EXPR is unsaved afterward, or
-   return 2 if it is completely unsafe. 
+   return 2 if it is completely unsafe.
 
    This assumes that CALL_EXPRs and TARGET_EXPRs are never replicated in
    an expression tree, so that it safe to unsave them and the surrounding
@@ -2715,7 +2711,7 @@ unsave_expr_now (expr)
    safe to unsave a SAVE_EXPR if you know that all occurrences appear
    below the UNSAVE_EXPR.
 
-   RTL_EXPRs consume their rtl during evaluation.  It is therefore 
+   RTL_EXPRs consume their rtl during evaluation.  It is therefore
    never possible to unsave them.  */
 
 int
@@ -2822,14 +2818,14 @@ contains_placeholder_p (exp)
                || (TREE_CHAIN (exp) != 0
                    && contains_placeholder_p (TREE_CHAIN (exp))));
       break;
-                                       
+
     case '1':
     case '2':  case '<':
     case 'e':
       switch (code)
        {
        case COMPOUND_EXPR:
-         /* Ignoring the first operand isn't quite right, but works best. */
+         /* Ignoring the first operand isn't quite right, but works best.  */
          return contains_placeholder_p (TREE_OPERAND (exp, 1));
 
        case RTL_EXPR:
@@ -2862,7 +2858,7 @@ contains_placeholder_p (exp)
          break;
        }
 
-      switch (tree_code_length[(int) code])
+      switch (TREE_CODE_LENGTH (code))
        {
        case 1:
          return contains_placeholder_p (TREE_OPERAND (exp, 0));
@@ -2981,13 +2977,13 @@ substitute_in_expr (exp, f, r)
     case '2':
     case '<':
     case 'e':
-      switch (tree_code_length[(int) code])
+      switch (TREE_CODE_LENGTH (code))
        {
        case 1:
          op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r);
          if (op0 == TREE_OPERAND (exp, 0))
            return exp;
-         
+
          new = fold (build1 (code, TREE_TYPE (exp), op0));
          break;
 
@@ -3056,7 +3052,7 @@ substitute_in_expr (exp, f, r)
              && TREE_OPERAND (exp, 1) == f)
            return r;
 
-         /* If this expression hasn't been completed let, leave it 
+         /* If this expression hasn't been completed let, leave it
             alone.  */
          if (TREE_CODE (inner) == PLACEHOLDER_EXPR
              && TREE_TYPE (inner) == 0)
@@ -3094,7 +3090,7 @@ substitute_in_expr (exp, f, r)
          abort ();
        }
       break;
-      
+
     default:
       abort ();
     }
@@ -3173,7 +3169,6 @@ stabilize_reference (ref)
                                          ref)));
       break;
 
-
       /* If arg isn't a kind of lvalue we recognize, make no change.
         Caller should recognize the error for an invalid lvalue.  */
     default:
@@ -3241,7 +3236,7 @@ stabilize_reference_1 (e)
       /* Constants need no processing.  In fact, we should never reach
         here.  */
       return e;
-      
+
     case '2':
       /* Division is slow and tends to be compiled with jumps,
         especially the division by powers of 2 that is often
@@ -3264,7 +3259,7 @@ stabilize_reference_1 (e)
     default:
       abort ();
     }
-  
+
   TREE_TYPE (result) = TREE_TYPE (e);
   TREE_READONLY (result) = TREE_READONLY (e);
   TREE_SIDE_EFFECTS (result) = TREE_SIDE_EFFECTS (e);
@@ -3301,7 +3296,7 @@ build VPARAMS ((enum tree_code code, tree tt, ...))
 #endif
 
   t = make_node (code);
-  length = tree_code_length[(int) code];
+  length = TREE_CODE_LENGTH (code);
   TREE_TYPE (t) = tt;
 
   /* Below, we automatically set TREE_SIDE_EFFECTS and TREE_RAISED for
@@ -3388,20 +3383,20 @@ build1 (code, type, node)
   if (ggc_p)
     t = ggc_alloc_tree (length);
   else
-    {
-      t = (tree) obstack_alloc (obstack, length);
-      memset ((PTR) t, 0, length);
-    }
+    t = (tree) obstack_alloc (obstack, length);
+
+  memset ((PTR) t, 0, sizeof (struct tree_common));
 
 #ifdef GATHER_STATISTICS
-  tree_node_counts[(int)kind]++;
-  tree_node_sizes[(int)kind] += length;
+  tree_node_counts[(int) kind]++;
+  tree_node_sizes[(int) kind] += length;
 #endif
 
-  TREE_TYPE (t) = type;
   TREE_SET_CODE (t, code);
   TREE_SET_PERMANENT (t);
 
+  TREE_TYPE (t) = type;
+  TREE_COMPLEXITY (t) = 0;
   TREE_OPERAND (t, 0) = node;
   if (node && first_rtl_op (code) != 0 && TREE_SIDE_EFFECTS (node))
     TREE_SIDE_EFFECTS (t) = 1;
@@ -3420,7 +3415,7 @@ build1 (code, type, node)
         operands are.  */
       TREE_SIDE_EFFECTS (t) = 1;
       break;
-         
+
     default:
       break;
     }
@@ -3451,7 +3446,7 @@ build_nt VPARAMS ((enum tree_code code, ...))
 #endif
 
   t = make_node (code);
-  length = tree_code_length[(int) code];
+  length = TREE_CODE_LENGTH (code);
 
   for (i = 0; i < length; i++)
     TREE_OPERAND (t, i) = va_arg (p, tree);
@@ -3484,7 +3479,7 @@ build_parse_node VPARAMS ((enum tree_code code, ...))
   expression_obstack = &temp_decl_obstack;
 
   t = make_node (code);
-  length = tree_code_length[(int) code];
+  length = TREE_CODE_LENGTH (code);
 
   for (i = 0; i < length; i++)
     TREE_OPERAND (t, i) = va_arg (p, tree);
@@ -3632,7 +3627,7 @@ build_type_attribute_variant (ttype, attribute)
                  + attribute_hash_list (attribute));
 
       switch (TREE_CODE (ntype))
-        {
+       {
        case FUNCTION_TYPE:
          hashcode += TYPE_HASH (TYPE_ARG_TYPES (ntype));
          break;
@@ -3647,7 +3642,7 @@ build_type_attribute_variant (ttype, attribute)
          break;
        default:
          break;
-        }
+       }
 
       ntype = type_hash_canon (hashcode, ntype);
       ttype = build_qualified_type (ntype, TYPE_QUALS (ttype));
@@ -3705,7 +3700,8 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
 
 #ifdef VALID_MACHINE_TYPE_ATTRIBUTE
   if (validated)
-    /* Don't apply the attribute to both the decl and the type.  */;
+    /* Don't apply the attribute to both the decl and the type.  */
+    ;
   else if (VALID_MACHINE_TYPE_ATTRIBUTE (type, type_attr_list, attr_name,
                                         attr_args))
     {
@@ -3723,7 +3719,7 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
       else
        {
          /* If this is part of a declaration, create a type variant,
-            otherwise, this is part of a type definition, so add it 
+            otherwise, this is part of a type definition, so add it
             to the base type.  */
          type_attr_list = tree_cons (attr_name, attr_args, type_attr_list);
          if (decl != 0)
@@ -3790,7 +3786,7 @@ is_attribute_p (attr, ident)
      tree ident;
 {
   int ident_len, attr_len;
-  char *p;
+  const char *p;
 
   if (TREE_CODE (ident) != IDENTIFIER_NODE)
     return 0;
@@ -3863,27 +3859,27 @@ merge_attributes (a1, a2)
   /* One that completely contains the other?  Take it.  */
 
   else if (a2 != 0 && ! attribute_list_contained (a1, a2))
-  {
-    if (attribute_list_contained (a2, a1))
-      attributes = a2;
-    else
-      {
-       /* Pick the longest list, and hang on the other list.  */
-       /* ??? For the moment we punt on the issue of attrs with args.  */
-
-       if (list_length (a1) < list_length (a2))
-         attributes = a2, a2 = a1;
-
-       for (; a2 != 0; a2 = TREE_CHAIN (a2))
-         if (lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (a2)),
-                               attributes) == NULL_TREE)
-           {
-             a1 = copy_node (a2);
-             TREE_CHAIN (a1) = attributes;
-             attributes = a1;
-           }
-      }
-  }
+    {
+      if (attribute_list_contained (a2, a1))
+       attributes = a2;
+      else
+       {
+         /* Pick the longest list, and hang on the other list.  */
+         /* ??? For the moment we punt on the issue of attrs with args.  */
+
+         if (list_length (a1) < list_length (a2))
+           attributes = a2, a2 = a1;
+
+         for (; a2 != 0; a2 = TREE_CHAIN (a2))
+           if (lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (a2)),
+                                 attributes) == NULL_TREE)
+             {
+               a1 = copy_node (a2);
+               TREE_CHAIN (a1) = attributes;
+               attributes = a1;
+             }
+       }
+    }
   return attributes;
 }
 
@@ -3923,7 +3919,7 @@ merge_machine_decl_attributes (olddecl, newdecl)
 static void
 set_type_quals (type, type_quals)
      tree type;
-     int  type_quals;
+     int type_quals;
 {
   TYPE_READONLY (type) = (type_quals & TYPE_QUAL_CONST) != 0;
   TYPE_VOLATILE (type) = (type_quals & TYPE_QUAL_VOLATILE) != 0;
@@ -3943,7 +3939,7 @@ build_qualified_type (type, type_quals)
      int type_quals;
 {
   register tree t;
-  
+
   /* Search the chain of variants to see if there is already one there just
      like the one we need to have.  If so, use that existing one.  We must
      preserve the TYPE_NAME, since there is code that depends on this.  */
@@ -4042,7 +4038,7 @@ static unsigned int
 type_hash_hash (item)
      const void *item;
 {
-  return ((const struct type_hash*)item)->hash;
+  return ((const struct type_hash *) item)->hash;
 }
 
 /* Look in the type hash table for a type isomorphic to TYPE.
@@ -4056,7 +4052,7 @@ type_hash_lookup (hashcode, type)
   struct type_hash *h, in;
 
   /* The TYPE_ALIGN field of a type is set by layout_type(), so we
-     must call that routine before comparing TYPE_ALIGNs. */
+     must call that routine before comparing TYPE_ALIGNs.  */
   layout_type (type);
 
   in.hash = hashcode;
@@ -4083,7 +4079,7 @@ type_hash_add (hashcode, type)
   h->hash = hashcode;
   h->type = type;
   loc = htab_find_slot_with_hash (type_hash_table, h, hashcode, INSERT);
-  *(struct type_hash**) loc = h;
+  *(struct type_hash **) loc = h;
 }
 
 /* Given TYPE, and HASHCODE its hash code, return the canonical
@@ -4137,7 +4133,7 @@ mark_hash_entry (entry, param)
      void **entry;
      void *param ATTRIBUTE_UNUSED;
 {
-  struct type_hash *p = *(struct type_hash **)entry;
+  struct type_hash *p = *(struct type_hash **) entry;
 
   ggc_mark_tree (p->type);
 
@@ -4209,7 +4205,7 @@ attribute_list_contained (l1, l2)
 
   /* First check the obvious, maybe the lists are identical.  */
   if (l1 == l2)
-     return 1;
+    return 1;
 
   /* Maybe the lists are similar.  */
   for (t1 = l1, t2 = l2;
@@ -4310,7 +4306,9 @@ host_integerp (t, pos)
          && ((TREE_INT_CST_HIGH (t) == 0
               && (HOST_WIDE_INT) TREE_INT_CST_LOW (t) >= 0)
              || (! pos && TREE_INT_CST_HIGH (t) == -1
-                 && (HOST_WIDE_INT) TREE_INT_CST_LOW (t) < 0)));
+                 && (HOST_WIDE_INT) TREE_INT_CST_LOW (t) < 0)
+             || (! pos && TREE_INT_CST_HIGH (t) == 0
+                 && TREE_UNSIGNED (TREE_TYPE (t)))));
 }
 
 /* Return the HOST_WIDE_INT least significant bits of T if it is an
@@ -4326,7 +4324,7 @@ tree_low_cst (t, pos)
     return TREE_INT_CST_LOW (t);
   else
     abort ();
-}  
+}
 
 /* Return the most significant bit of the integer constant T.  */
 
@@ -4344,7 +4342,7 @@ tree_int_cst_msb (t)
   rshift_double (TREE_INT_CST_LOW (t), TREE_INT_CST_HIGH (t), prec,
                 2 * HOST_BITS_PER_WIDE_INT, &l, &h, 0);
   return (l & 1) == 1;
-  }
+}
 
 /* Return an indication of the sign of the integer constant T.
    The return value is -1 if T < 0, 0 if T == 0, and 1 if T > 0.
@@ -4364,25 +4362,6 @@ tree_int_cst_sgn (t)
     return 1;
 }
 
-/* Return true if `t' is known to be non-negative.  */
-
-int
-tree_expr_nonnegative_p (t)
-     tree t;
-{
-  switch (TREE_CODE (t))
-    {
-    case INTEGER_CST:
-      return tree_int_cst_sgn (t) >= 0;
-    case COND_EXPR:
-      return tree_expr_nonnegative_p (TREE_OPERAND (t, 1))
-       && tree_expr_nonnegative_p (TREE_OPERAND (t, 2));
-    default:
-      /* We don't know sign of `t', so be safe and return false.  */
-      return 0;
-    }
-}
-
 /* Compare two constructor-element-type constants.  Return 1 if the lists
    are known to be equal; otherwise return 0.  */
 
@@ -4508,7 +4487,7 @@ simple_cst_equal (t1, t2)
     case CONST_DECL:
     case FUNCTION_DECL:
       return 0;
-      
+
     default:
       break;
     }
@@ -4529,7 +4508,7 @@ simple_cst_equal (t1, t2)
     case 'r':
     case 's':
       cmp = 1;
-      for (i = 0; i < tree_code_length[(int) code1]; i++)
+      for (i = 0; i < TREE_CODE_LENGTH (code1); i++)
        {
          cmp = simple_cst_equal (TREE_OPERAND (t1, i), TREE_OPERAND (t2, i));
          if (cmp <= 0)
@@ -4655,6 +4634,7 @@ build_index_type (maxval)
   TYPE_SIZE (itype) = TYPE_SIZE (sizetype);
   TYPE_SIZE_UNIT (itype) = TYPE_SIZE_UNIT (sizetype);
   TYPE_ALIGN (itype) = TYPE_ALIGN (sizetype);
+  TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (sizetype);
 
   if (host_integerp (maxval, 1))
     return type_hash_canon (tree_low_cst (maxval, 1), itype);
@@ -4687,6 +4667,7 @@ build_range_type (type, lowval, highval)
   TYPE_SIZE (itype) = TYPE_SIZE (type);
   TYPE_SIZE_UNIT (itype) = TYPE_SIZE_UNIT (type);
   TYPE_ALIGN (itype) = TYPE_ALIGN (type);
+  TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (type);
 
   if (host_integerp (lowval, 0) && highval != 0 && host_integerp (highval, 0))
     return type_hash_canon (tree_low_cst (highval, 0)
@@ -4962,7 +4943,7 @@ build_complex_type (component_type)
    OP must have integer, real or enumeral type.  Pointers are not allowed!
 
    There are some cases where the obvious value we could return
-   would regenerate to OP if converted to OP's type, 
+   would regenerate to OP if converted to OP's type,
    but would not extend like OP to wider types.
    If FOR_TYPE indicates such extension is contemplated, we eschew such values.
    For example, if OP is (unsigned short)(signed char)-1,
@@ -5211,7 +5192,7 @@ decl_function_context (decl)
     {
       if (TREE_CODE (context) == BLOCK)
        context = BLOCK_SUPERCONTEXT (context);
-      else 
+      else
        context = get_containing_scope (context);
     }
 
@@ -5250,7 +5231,7 @@ decl_type_context (decl)
 }
 
 /* CALL is a CALL_EXPR.  Return the declaration for the function
-   called, or NULL_TREE if the called function cannot be 
+   called, or NULL_TREE if the called function cannot be
    determined.  */
 
 tree
@@ -5406,6 +5387,26 @@ append_random_chars (template)
   template[6] = '\0';
 }
 
+/* P is a string that will be used in a symbol.  Mask out any characters
+   that are not valid in that context.  */
+
+void
+clean_symbol_name (p)
+     char *p;
+{
+  for (; *p; p++)
+    if (! (ISDIGIT(*p)
+#ifndef NO_DOLLAR_IN_LABEL     /* this for `$'; unlikely, but... -- kr */
+           || *p == '$'
+#endif
+#ifndef NO_DOT_IN_LABEL                /* this for `.'; unlikely, but...  */
+           || *p == '.'
+#endif
+           || ISUPPER (*p)
+           || ISLOWER (*p)))
+      *p = '_';
+}
+  
 /* Generate a name for a function unique to this translation unit.
    TYPE is some string to identify the purpose of this function to the
    linker or collect2.  */
@@ -5443,7 +5444,7 @@ get_file_function_name_long (type)
   buf = (char *) alloca (sizeof (FILE_FUNCTION_FORMAT) + strlen (p)
                         + strlen (type));
 
-  /* Set up the name of the file-level functions we may need. 
+  /* Set up the name of the file-level functions we may need.
      Use a global object (which is already required to be unique over
      the program) rather than the file name (which imposes extra
      constraints).  */
@@ -5451,19 +5452,7 @@ get_file_function_name_long (type)
 
   /* Don't need to pull weird characters out of global names.  */
   if (p != first_global_object_name)
-    {
-      for (q = buf+11; *q; q++)
-       if (! ( ISDIGIT(*q)
-#ifndef NO_DOLLAR_IN_LABEL     /* this for `$'; unlikely, but... -- kr */
-              || *q == '$'
-#endif
-#ifndef NO_DOT_IN_LABEL                /* this for `.'; unlikely, but...  */
-              || *q == '.'
-#endif
-              || ISUPPER(*q)
-              || ISLOWER(*q)))
-         *q = '_';
-    }
+    clean_symbol_name (buf + 11);
 
   return get_identifier (buf);
 }
@@ -5504,7 +5493,7 @@ get_set_constructor_bits (init, buffer, bit_size)
   for (i = 0; i < bit_size; i++)
     buffer[i] = 0;
 
-  for (vals = TREE_OPERAND (init, 1); 
+  for (vals = TREE_OPERAND (init, 1);
        vals != NULL_TREE; vals = TREE_CHAIN (vals))
     {
       if (TREE_CODE (TREE_VALUE (vals)) != INTEGER_CST
@@ -5521,9 +5510,9 @@ get_set_constructor_bits (init, buffer, bit_size)
            = TREE_INT_CST_LOW (TREE_VALUE (vals)) - domain_min;
 
          if (lo_index < 0 || lo_index >= bit_size
-           || hi_index < 0 || hi_index >= bit_size)
+             || hi_index < 0 || hi_index >= bit_size)
            abort ();
-         for ( ; lo_index <= hi_index; lo_index++)
+         for (; lo_index <= hi_index; lo_index++)
            buffer[lo_index] = 1;
        }
       else
@@ -5558,7 +5547,7 @@ get_set_constructor_bytes (init, buffer, wd_size)
   int bit_size = wd_size * set_word_size;
   int bit_pos = 0;
   unsigned char *bytep = buffer;
-  char *bit_buffer = (char *) alloca(bit_size);
+  char *bit_buffer = (char *) alloca (bit_size);
   tree non_const_bits = get_set_constructor_bits (init, bit_buffer, bit_size);
 
   for (i = 0; i < wd_size; i++)
@@ -5583,6 +5572,7 @@ get_set_constructor_bytes (init, buffer, wd_size)
 #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
 /* Complain that the tree code of NODE does not match the expected CODE.
    FILE, LINE, and FUNCTION are of the caller.  */
+
 void
 tree_check_failed (node, code, file, line, function)
      const tree node;
@@ -5598,10 +5588,11 @@ tree_check_failed (node, code, file, line, function)
 
 /* Similar to above, except that we check for a class of tree
    code, given in CL.  */
+
 void
 tree_class_check_failed (node, cl, file, line, function)
      const tree node;
-     char cl;
+     int cl;
      const char *file;
      int line;
      const char *function;
@@ -5613,35 +5604,34 @@ tree_class_check_failed (node, cl, file, line, function)
 }
 
 #endif /* ENABLE_TREE_CHECKING */
+\f
+/* For a new vector type node T, build the information necessary for
+   debuggint output.  */
 
-/* Return the alias set for T, which may be either a type or an
-   expression.  */
-
-int
-get_alias_set (t)
+static void
+finish_vector_type (t)
      tree t;
 {
-  if (! flag_strict_aliasing || lang_get_alias_set == 0)
-    /* If we're not doing any lanaguage-specific alias analysis, just
-       assume everything aliases everything else.  */
-    return 0;
-  else
-    return (*lang_get_alias_set) (t);
-}
-
-/* Return a brand-new alias set.  */
-
-int
-new_alias_set ()
-{
-  static int last_alias_set;
+  layout_type (t);
 
-  if (flag_strict_aliasing)
-    return ++last_alias_set;
-  else
-    return 0;
+  {
+    tree index = build_int_2 (TYPE_VECTOR_SUBPARTS (t) - 1, 0);
+    tree array = build_array_type (TREE_TYPE (t),
+                                  build_index_type (index));
+    tree rt = make_node (RECORD_TYPE);
+
+    TYPE_FIELDS (rt) = build_decl (FIELD_DECL, get_identifier ("f"), array);
+    DECL_CONTEXT (TYPE_FIELDS (rt)) = rt;
+    layout_type (rt);
+    TYPE_DEBUG_REPRESENTATION_TYPE (t) = rt;
+    /* In dwarfout.c, type lookup uses TYPE_UID numbers.  We want to output
+       the representation type, and we want to find that die when looking up
+       the vector type.  This is most easily achieved by making the TYPE_UID
+       numbers equal.  */
+    TYPE_UID (rt) = TYPE_UID (t);
+  }
 }
-\f
+
 #ifndef CHAR_TYPE_SIZE
 #define CHAR_TYPE_SIZE BITS_PER_UNIT
 #endif
@@ -5677,7 +5667,7 @@ new_alias_set ()
 /* Create nodes for all integer types (and error_mark_node) using the sizes
    of C datatypes.  The caller should call set_sizetype soon after calling
    this function to select one of the types as sizetype.  */
-   
+
 void
 build_common_tree_nodes (signed_char)
      int signed_char;
@@ -5711,13 +5701,17 @@ build_common_tree_nodes (signed_char)
   intHI_type_node = make_signed_type (GET_MODE_BITSIZE (HImode));
   intSI_type_node = make_signed_type (GET_MODE_BITSIZE (SImode));
   intDI_type_node = make_signed_type (GET_MODE_BITSIZE (DImode));
+#if HOST_BITS_PER_WIDE_INT >= 64
   intTI_type_node = make_signed_type (GET_MODE_BITSIZE (TImode));
+#endif
 
   unsigned_intQI_type_node = make_unsigned_type (GET_MODE_BITSIZE (QImode));
   unsigned_intHI_type_node = make_unsigned_type (GET_MODE_BITSIZE (HImode));
   unsigned_intSI_type_node = make_unsigned_type (GET_MODE_BITSIZE (SImode));
   unsigned_intDI_type_node = make_unsigned_type (GET_MODE_BITSIZE (DImode));
+#if HOST_BITS_PER_WIDE_INT >= 64
   unsigned_intTI_type_node = make_unsigned_type (GET_MODE_BITSIZE (TImode));
+#endif
 }
 
 /* Call this function after calling build_common_tree_nodes and set_sizetype.
@@ -5743,6 +5737,7 @@ build_common_tree_nodes_2 (short_double)
   /* We are not going to have real types in C with less than byte alignment,
      so we might as well not have any types that claim to have it.  */
   TYPE_ALIGN (void_type_node) = BITS_PER_UNIT;
+  TYPE_USER_ALIGN (void_type_node) = 0;
 
   null_pointer_node = build_int_2 (0, 0);
   TREE_TYPE (null_pointer_node) = build_pointer_type (void_type_node);
@@ -5784,8 +5779,33 @@ build_common_tree_nodes_2 (short_double)
   layout_type (complex_long_double_type_node);
 
 #ifdef BUILD_VA_LIST_TYPE
-  BUILD_VA_LIST_TYPE(va_list_type_node);
+  BUILD_VA_LIST_TYPE (va_list_type_node);
 #else
   va_list_type_node = ptr_type_node;
 #endif
+
+  V4SF_type_node = make_node (VECTOR_TYPE);
+  TREE_TYPE (V4SF_type_node) = float_type_node;
+  TYPE_MODE (V4SF_type_node) = V4SFmode;
+  finish_vector_type (V4SF_type_node);
+
+  V4SI_type_node = make_node (VECTOR_TYPE);
+  TREE_TYPE (V4SI_type_node) = intSI_type_node;
+  TYPE_MODE (V4SI_type_node) = V4SImode;
+  finish_vector_type (V4SI_type_node);
+
+  V2SI_type_node = make_node (VECTOR_TYPE);
+  TREE_TYPE (V2SI_type_node) = intSI_type_node;
+  TYPE_MODE (V2SI_type_node) = V2SImode;
+  finish_vector_type (V2SI_type_node);
+
+  V4HI_type_node = make_node (VECTOR_TYPE);
+  TREE_TYPE (V4HI_type_node) = intHI_type_node;
+  TYPE_MODE (V4HI_type_node) = V4HImode;
+  finish_vector_type (V4HI_type_node);
+
+  V8QI_type_node = make_node (VECTOR_TYPE);
+  TREE_TYPE (V8QI_type_node) = intQI_type_node;
+  TYPE_MODE (V8QI_type_node) = V8QImode;
+  finish_vector_type (V8QI_type_node);
 }