OSDN Git Service

* config/alpha/vms.h (INCLUDE_DEFAULTS): Add /gnu/lib/gcc-lib/include.
[pf3gnuchains/gcc-fork.git] / gcc / ch / decl.c
index 57842b0..01ca9e6 100644 (file)
@@ -1,21 +1,23 @@
 /* Process declarations and variables for GNU CHILL compiler.
-   Copyright (C) 1992, 93, 1994 Free Software Foundation, Inc. 
+   Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc. 
    
-   This file is part of GNU CC.
-   
-   GNU CC is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
    
-   GNU CC is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
    
-   You should have received a copy of the GNU General Public License
-   along with GNU CC; see the file COPYING.  If not, write to
-   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+You should have received a copy of the GNU General Public License
+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.  */
 
 
 /* Process declarations and symbol lookup for CHILL front end.
@@ -83,7 +85,7 @@
    This must be done before we can Layout a.
    The reason this is an issue is that we do *not* have a lookup
    (or hash) table per scope (or module).  Instead we have a single
-   global table we we keep adding and removing bindings from.
+   global table we keep adding and removing bindings from.
    (This is both for speed, and because of gcc history.)
 
    Note that a SEIZE generates a declaration in the current scope,
 /* ??? not all decl nodes are given the most useful possible
    line numbers.  For example, the CONST_DECLs for enum values.  */
 
-#include <stdio.h>
 #include "config.h"
+#include "system.h"
 #include "tree.h"
 #include "flags.h"
 #include "ch-tree.h"
 #include "obstack.h"
 #include "input.h"
 #include "rtl.h"
+#include "toplev.h"
+#include "diagnostic.h"
 
 #define IS_UNKNOWN_TYPE(type) (TYPE_SIZE(type)==0)
 #define BUILTIN_NESTING_LEVEL (-1)
@@ -203,30 +207,12 @@ extern struct obstack *saveable_obstack;
 extern tree signal_code;
 extern int special_UC;
 
-extern void tasking_init              PROTO((void));
-extern void error                     PROTO((char *, ...));
-extern void error_with_decl           PROTO((tree, char *, ...));
-extern void expand_decl               PROTO((tree));
-static tree get_next_decl             PROTO((void));
-extern tree get_parm_decls            PROTO((void));
-extern void end_temporary_allocation  PROTO((void));
-extern void indent_to                 PROTO((FILE *, int));
-#ifdef RTX_CODE
-extern rtx  label_rtx                 PROTO((tree));
+static tree get_next_decl             PARAMS ((void));
+static tree lookup_name_for_seizing   PARAMS ((tree));
+#if 0
+static tree lookup_name_current_level PARAMS ((tree));
 #endif
-extern tree lookup_name_for_seizing   PROTO((tree));
-extern tree lookup_name_current_level PROTO((tree));
-extern int  operand_equal_p           PROTO((tree, tree, int));
-extern void pedwarn_with_decl         PROTO((tree, char *, ...));
-extern void print_node                PROTO((FILE *, char *, tree, int));
-extern void push_granted              PROTO((tree, tree));
-extern void push_obstacks             PROTO((struct obstack *, struct obstack *));
-extern void rest_of_decl_compilation  PROTO((tree, char *, int, int));
-extern void sorry                     PROTO((char *, ...));
-static void save_decl                 PROTO((tree));
-extern void start_identifier_warnings PROTO((void));
-extern void temporary_allocation      PROTO((void));
-extern void warning                   PROTO((char *, ...));
+static void save_decl                 PARAMS ((tree));
 
 extern struct obstack permanent_obstack;
 extern int in_pseudo_module;
@@ -256,9 +242,21 @@ tree chill_result_decl;
 int result_never_set;
 
 /* forward declarations */
-static void pushdecllist                     PROTO((tree, int));
-static int  init_nonvalue_struct             PROTO((tree));
-static int  init_nonvalue_array              PROTO((tree));
+static void pushdecllist                     PARAMS ((tree, int));
+static int  init_nonvalue_struct             PARAMS ((tree));
+static int  init_nonvalue_array              PARAMS ((tree));
+static void set_nesting_level                PARAMS ((tree, int));
+static tree make_chill_variants              PARAMS ((tree, tree, tree));
+static tree fix_identifier                   PARAMS ((tree));
+static void proclaim_decl                    PARAMS ((tree, int));
+static tree maybe_acons                      PARAMS ((tree, tree));
+static void push_scope_decls                 PARAMS ((int));
+static void pop_scope_decls                  PARAMS ((tree, tree));
+static tree build_implied_names              PARAMS ((tree));
+static void bind_sub_modules                 PARAMS ((int));
+static void layout_array_type                PARAMS ((tree));
+static void do_based_decl                    PARAMS ((tree, tree, tree));
+static void handle_one_level                 PARAMS ((tree, tree));
 
 int current_nesting_level = BUILTIN_NESTING_LEVEL;
 int current_module_nesting_level = 0;
@@ -267,52 +265,6 @@ int current_module_nesting_level = 0;
 /* ??? not all decl nodes are given the most useful possible
    line numbers.  For example, the CONST_DECLs for enum values.  */
 
-#if 0
-/* In grokdeclarator, distinguish syntactic contexts of declarators.  */
-enum decl_context
-{ NORMAL,                      /* Ordinary declaration */
-    FUNCDEF,                   /* Function definition */
-    PARM,                      /* Declaration of parm before function body */
-    FIELD,                     /* Declaration inside struct or union */
-    BITFIELD,                  /* Likewise but with specified width */
-    TYPENAME};                 /* Typename (inside cast or sizeof)  */
-#endif
-
-#ifndef CHAR_TYPE_SIZE
-#define CHAR_TYPE_SIZE BITS_PER_UNIT
-#endif
-
-#ifndef SHORT_TYPE_SIZE
-#define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
-#endif
-
-#ifndef INT_TYPE_SIZE
-#define INT_TYPE_SIZE BITS_PER_WORD
-#endif
-
-#ifndef LONG_TYPE_SIZE
-#define LONG_TYPE_SIZE BITS_PER_WORD
-#endif
-
-#ifndef LONG_LONG_TYPE_SIZE
-#define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
-#endif
-
-#ifndef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-#endif
-
-#ifndef FLOAT_TYPE_SIZE
-#define FLOAT_TYPE_SIZE BITS_PER_WORD
-#endif
-
-#ifndef DOUBLE_TYPE_SIZE
-#define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
-#endif
-
-#ifndef LONG_DOUBLE_TYPE_SIZE
-#define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
-#endif
 
 /* We let tm.h override the types used here, to handle trivial differences
    such as the choice of unsigned int or long unsigned int for size_t.
@@ -328,64 +280,12 @@ enum decl_context
 #define WCHAR_TYPE "int"
 #endif
 \f
-/* a node which has tree code ERROR_MARK, and whose type is itself.
-   All erroneous expressions are replaced with this node.  All functions
-   that accept nodes as arguments should avoid generating error messages
-   if this node is one of the arguments, since it is undesirable to get
-   multiple error messages from one error in the input.  */
-
-tree error_mark_node;
-
-/* INTEGER_TYPE and REAL_TYPE nodes for the standard data types */
-
-tree short_integer_type_node;
-tree integer_type_node;
-tree long_integer_type_node;
-tree long_long_integer_type_node;
-
-tree short_unsigned_type_node;
-tree unsigned_type_node;
-tree long_unsigned_type_node;
-tree long_long_unsigned_type_node;
-
-tree ptrdiff_type_node;
-
-tree unsigned_char_type_node;
-tree signed_char_type_node;
-tree char_type_node;
 tree wchar_type_node;
 tree signed_wchar_type_node;
 tree unsigned_wchar_type_node;
 
-tree float_type_node;
-tree double_type_node;
-tree long_double_type_node;
-
-tree complex_integer_type_node;
-tree complex_float_type_node;
-tree complex_double_type_node;
-tree complex_long_double_type_node;
-
-tree intQI_type_node;
-tree intHI_type_node;
-tree intSI_type_node;
-tree intDI_type_node;
-tree intTI_type_node;
-
-tree unsigned_intQI_type_node;
-tree unsigned_intHI_type_node;
-tree unsigned_intSI_type_node;
-tree unsigned_intDI_type_node;
-tree unsigned_intTI_type_node;
-
-/* a VOID_TYPE node.  */
-
-tree void_type_node;
 tree void_list_node;
 
-/* Nodes for types `void *' and `const void *'.  */
-tree ptr_type_node, const_ptr_type_node;
-
 /* type of initializer structure, which points to
    a module's module-level code, and to the next
    such structure. */
@@ -398,36 +298,7 @@ tree chill_predefined_function_type;
 
 tree default_function_type;
 
-#if 0
-/* function types `double (double)' and `double (double, double)', etc.  */
-
-tree double_ftype_double, double_ftype_double_double;
-tree int_ftype_int, long_ftype_long;
-
-/* Function type `void (void *, void *, int)' and similar ones */
-
-tree void_ftype_ptr_ptr_int, int_ftype_ptr_ptr_int, void_ftype_ptr_int_int;
-
-/* Function type `char *(char *, char *)' and similar ones */
-tree string_ftype_ptr_ptr, int_ftype_string_string;
-
-/* Function type `int (const void *, const void *, size_t)' */
-tree int_ftype_cptr_cptr_sizet;
-#endif
-
-char **boolean_code_name;
-
-/* Two expressions that are constants with value zero.
-   The first is of type `int', the second of type `void *'.  */
-
-tree integer_zero_node;
-tree null_pointer_node;
-
-/* A node for the integer constant 1.  */
-tree integer_one_node;
-
-/* A node for the integer constant -1.  */
-tree integer_minus_one_node;
+const char **boolean_code_name;
 
 /* Nodes for boolean constants TRUE and FALSE. */
 tree boolean_true_node, boolean_false_node;
@@ -456,10 +327,6 @@ static tree current_function_parms;
 
 static int c_function_varargs;
 
-/* The FUNCTION_DECL for the function currently being compiled,
-   or 0 if between functions.  */
-tree current_function_decl;
-
 /* These are irrelevant for Chill, but are referenced from from c-typeck.c. */
 int warn_format;
 int warn_traditional;
@@ -547,7 +414,9 @@ struct scope
 
 /* The outermost binding level, for pre-defined (builtin) names. */
 
-static struct scope builtin_scope = { NULL, NULL, NULL_TREE};
+static struct scope builtin_scope = {
+  NULL, NULL, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE,
+  NULL_TREE, NULL_TREE, NULL, 0, 0, NULL, NULL, NULL};
 
 struct scope *global_scope;
 
@@ -560,21 +429,14 @@ struct scope *last_scope = &builtin_scope;
 
 /* Binding level structures are initialized by copying this one.  */
 
-static struct scope clear_scope
-  = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0};
+static struct scope clear_scope = {
+  NULL, NULL, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE,
+  NULL_TREE, NULL_TREE, NULL, 0, 0, NULL, NULL, NULL};
 
 /* Chain of decls accessible through IDENTIFIER_OUTER_VALUE.
    Decls with the same DECL_NAME are adjacent in the chain. */
 
 static tree outer_decls = NULL_TREE;
-
-/* Forward declarations.  */
-
-tree pushdecl ();
-tree builtin_function ();
-
-tree lookup_name_current_level ();
-static void layout_array_type ();
 \f
 /* C-specific option variables.  */
 
@@ -600,23 +462,11 @@ int flag_no_builtin;
 
 int flag_no_nonansi_builtin;
 
-/* Nonzero means do some things the same way PCC does.  */
-
-int flag_traditional;
-
-/* Nonzero means to allow single precision math even if we're generally
-   being traditional. */
-int flag_allow_single_precision = 0;
-
 /* Nonzero means to treat bitfields as signed unless they say `unsigned'.  */
 
 int flag_signed_bitfields = 1;
 int explicit_flag_signed_bitfields = 0;
 
-/* Nonzero means handle `#ident' directives.  0 means ignore them.  */
-
-int flag_no_ident = 0;
-
 /* Nonzero means warn about implicit declarations.  */
 
 int warn_implicit;
@@ -684,7 +534,8 @@ int warn_missing_braces;
 
 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
   
-  char chill_tree_code_type[] = {
+const char tree_code_type[] = {
+#include "tree.def"
     'x',
 #include "ch-tree.def"
   };
@@ -696,7 +547,8 @@ int warn_missing_braces;
 
 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
   
-int chill_tree_code_length[] = {
+const unsigned char tree_code_length[] = {
+#include "tree.def"
     0,
 #include "ch-tree.def"
   };
@@ -707,15 +559,14 @@ int chill_tree_code_length[] = {
    Used for printing out the tree and error messages.  */
 #define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
   
-char *chill_tree_code_name[] = {
+const char *const tree_code_name[] = {
+#include "tree.def"
     "@@dummy",
 #include "ch-tree.def"
   };
 #undef DEFTREECODE
 
-/* Nonzero means `$' can be in an identifier.
-   See cccp.c for reasons why this breaks some obscure ANSI C programs.  */
-
+/* Nonzero means `$' can be in an identifier. */
 #ifndef DOLLARS_IN_IDENTIFIERS
 #define DOLLARS_IN_IDENTIFIERS 0
 #endif
@@ -730,14 +581,14 @@ tree ALL_POSTFIX;
 \f
 void
 allocate_lang_decl (t)
-     tree t;
+     tree t ATTRIBUTE_UNUSED;
 {
   /* Nothing needed */
 }
 
 void
 copy_lang_decl (node)
-     tree node;
+     tree node ATTRIBUTE_UNUSED;
 {
   /* Nothing needed */
 }
@@ -757,25 +608,12 @@ build_lang_decl (code, name, type)
 
 int
 c_decode_option (argc, argv)
-     int argc;
+     int argc ATTRIBUTE_UNUSED;
      char **argv;
 {
   char *p = argv[0];
-  if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
-    {
-      flag_traditional = 1;
-      flag_writable_strings = 1;
-#if DOLLARS_IN_IDENTIFIERS > 0
-      dollars_in_ident = 1;
-#endif
-    }
-  else if (!strcmp (p, "-fnotraditional") || !strcmp (p, "-fno-traditional"))
-    {
-      flag_traditional = 0;
-      flag_writable_strings = 0;
-      dollars_in_ident = DOLLARS_IN_IDENTIFIERS > 1;
-    }
-  else if (!strcmp (p, "-fsigned-char"))
+
+  if (!strcmp (p, "-fsigned-char"))
     flag_signed_char = 1;
   else if (!strcmp (p, "-funsigned-char"))
     flag_signed_char = 0;
@@ -815,10 +653,6 @@ c_decode_option (argc, argv)
     flag_no_builtin = 0;
   else if (!strcmp (p, "-fno-builtin"))
     flag_no_builtin = 1;
-  else if (!strcmp (p, "-fno-ident"))
-    flag_no_ident = 1;
-  else if (!strcmp (p, "-fident"))
-    flag_no_ident = 0;
   else if (!strcmp (p, "-ansi"))
     flag_no_asm = 1, flag_no_nonansi_builtin = 1, dollars_in_ident = 0;
   else if (!strcmp (p, "-Wimplicit"))
@@ -899,7 +733,7 @@ c_decode_option (argc, argv)
        warn_uninitialized = 2;
       warn_implicit = 1;
       warn_return_type = 1;
-      warn_unused = 1;
+      set_Wunused (1);
       warn_char_subscripts = 1;
       warn_parentheses = 1;
       warn_missing_braces = 1;
@@ -919,7 +753,9 @@ print_lang_decl (file, node, indent)
      int  indent;
 {
   indent_to (file, indent + 3);
-  fprintf (file, "nesting_level %d ", DECL_NESTING_LEVEL (node));
+  fputs ("nesting_level ", file);
+  fprintf (file, HOST_WIDE_INT_PRINT_DEC, DECL_NESTING_LEVEL (node));
+  fputs (" ", file);
   if (DECL_WEAK_NAME (node))
     fprintf (file, "weak_name ");
   if (CH_DECL_SIGNAL (node))
@@ -1058,7 +894,7 @@ init_nonvalue_array (expr)
 \f
 /* This excessive piece of code sets DECL_NESTING_LEVEL (DECL) to LEVEL. */
 
-void
+static void
 set_nesting_level (decl, level)
      tree decl;
      int level;
@@ -1202,7 +1038,7 @@ do_decl (name, type, is_static, lifetime_bound, opt_init, opt_external)
          if (CH_TYPE_NONVALUE_P (type))
            {
              error_with_decl (decl,
-                              "no initialisation allowed for `%s'");
+                              "no initialization allowed for `%s'");
              temp = NULL_TREE;
            }
          else if (TREE_CODE (type) == REFERENCE_TYPE)
@@ -1342,8 +1178,8 @@ build_chill_function_type (return_type, argtypes, exceptions, recurse_p)
  */
 tree
 push_extern_function (name, typespec, argtypes, exceptions, granting)
-     tree name, typespec, argtypes, exceptions;
-     int granting; /* If 0 do pushdecl(); if 1 do push_granted(). */
+  tree name, typespec, argtypes, exceptions;
+  int granting ATTRIBUTE_UNUSED;/*If 0 do pushdecl(); if 1 do push_granted()*/
 {
   tree ftype, fndecl;
   
@@ -1459,12 +1295,22 @@ print_mode (mode)
          {
            tree itype = TYPE_DOMAIN (mode);
            if (CH_STRING_TYPE_P (mode))
-             printf (" STRING (%d) OF ",
-                     TREE_INT_CST_LOW (TYPE_MAX_VALUE (itype)));
+             {
+               fputs (" STRING (", stdout);
+               printf (HOST_WIDE_INT_PRINT_DEC,
+                       TREE_INT_CST_LOW (TYPE_MAX_VALUE (itype)));
+               fputs (") OF ", stdout);
+             }
            else
-             printf (" ARRAY (%d:%d) OF ",
-                     TREE_INT_CST_LOW (TYPE_MIN_VALUE (itype)),
-                     TREE_INT_CST_LOW (TYPE_MAX_VALUE (itype)));
+             {
+               fputs (" ARRAY (", stdout);
+               printf (HOST_WIDE_INT_PRINT_DEC,
+                       TREE_INT_CST_LOW (TYPE_MIN_VALUE (itype)));
+               fputs (":", stdout);
+               printf (HOST_WIDE_INT_PRINT_DEC,
+                       TREE_INT_CST_LOW (TYPE_MAX_VALUE (itype)));
+               fputs (") OF ", stdout);
+             }
            mode = TREE_TYPE (mode);
            break;
          }
@@ -1628,6 +1474,8 @@ struct tree_pair
   tree decl;
 };
 
+static int  label_value_cmp                  PARAMS ((struct tree_pair *,
+                                                   struct tree_pair *));
 
 /* Function to help qsort sort variant labels by value order.  */
 static int
@@ -1637,7 +1485,7 @@ label_value_cmp (x, y)
   return TREE_INT_CST_LOW (x->value) - TREE_INT_CST_LOW (y->value);
 }
 \f
-tree
+static tree
 make_chill_variants (tagfields, body, variantelse)
      tree tagfields;
      tree body;
@@ -1690,7 +1538,7 @@ layout_chill_variants (utype)
      tree utype;
 {
   tree first = TYPE_FIELDS (utype);
-  int nlabels = 0, label_index = 0;
+  int nlabels, label_index = 0;
   struct tree_pair *label_value_array;
   tree decl;
   extern int errorcount;
@@ -1746,7 +1594,6 @@ layout_chill_variants (utype)
                    error_with_decl (TYPE_FIELDS (t),
                                     "inconsistent modes between labels and tag field");
                }
-             nlabels++;
            }
        }
       if (tagfields != NULL_TREE)
@@ -1755,6 +1602,21 @@ layout_chill_variants (utype)
        error ("too many tag labels");
     }
 
+  /* Compute the number of labels to be checked for duplicates.  */
+  nlabels = 0;
+  for (decl = first; decl; decl = TREE_CHAIN (decl))
+    {
+      tree t = TREE_TYPE (decl);
+       /* Only one tag (first case_label_list) supported, for now. */
+      tree labellist = TYPE_TAG_VALUES (t);
+      if (labellist)
+       labellist = TREE_VALUE (labellist);
+      
+      for (; labellist != NULL_TREE; labellist = TREE_CHAIN (labellist))
+       if (TREE_CODE (TREE_VALUE (labellist)) == INTEGER_CST)
+         nlabels++;
+    }
+
   /* Check for duplicate label values.  */
   label_value_array = (struct tree_pair *)alloca (nlabels * sizeof (struct tree_pair));
   for (decl = first; decl; decl = TREE_CHAIN (decl))
@@ -1805,7 +1667,8 @@ layout_chill_variants (utype)
     {
       int limit;
       qsort (label_value_array,
-            label_index, sizeof (struct tree_pair), label_value_cmp);
+            label_index, sizeof (struct tree_pair),
+            (int (*) PARAMS ((const void *, const void *))) label_value_cmp);
       limit = label_index - 1;
       for (label_index = 0; label_index < limit; label_index++)
        {
@@ -2031,7 +1894,8 @@ start_chill_function (label, rtype, parms, exceptlist, attrs)
     {
       /* We use the same name as the keyword.
         This makes it easy to print and change the RESULT from gdb. */
-      char *result_str = (ignore_case || ! special_UC) ? "result" : "RESULT";
+      const char *result_str =
+       (ignore_case || ! special_UC) ? "result" : "RESULT";
       if (pass == 2 && TREE_CODE (result_type) == ERROR_MARK)
        TREE_TYPE (current_scope->remembered_decls) = result_type;
       chill_result_decl = do_decl (get_identifier (result_str),
@@ -2079,9 +1943,6 @@ finish_chill_function ()
          /* Generate rtl for function exit.  */
          expand_function_end (input_filename, lineno, 0);
 
-         /* So we can tell if jump_optimize sets it to 1.  */
-         can_reach_end = 0;
-
          /* Run the optimizers and output assembler code for this function. */
          rest_of_compilation (fndecl);
        }
@@ -2197,7 +2058,9 @@ get_next_decl ()
 void
 switch_to_pass_2 ()
 {
+#if 0
   extern int errorcount, sorrycount;
+#endif
   if (current_scope != &builtin_scope)
     abort ();
   last_scope = &builtin_scope;
@@ -2325,14 +2188,14 @@ push_module (name, is_spec_module)
   return name;   /* may have generated a name */
 }
 /* Make a copy of the identifier NAME, replacing each '!' by '__'. */
-tree
+static tree
 fix_identifier (name)
      tree name;
 {
   char *buf = (char*)alloca (2 * IDENTIFIER_LENGTH (name) + 1);
   int fixed = 0;
   register char *dptr = buf;
-  register char *sptr = IDENTIFIER_POINTER (name);
+  register const char *sptr = IDENTIFIER_POINTER (name);
   for (; *sptr; sptr++)
     {
       if (*sptr == '!')
@@ -2397,7 +2260,7 @@ find_granted_decls ()
            }
          if (!found)
            {
-             error_with_decl (alias, "Nothing named `%s' to grant.");
+             error_with_decl (alias, "nothing named `%s' to grant");
              DECL_ABSTRACT_ORIGIN (alias) = error_mark_node;
            }
        }
@@ -2486,7 +2349,7 @@ kept_level_p ()
    Check redefinitions at the same level.
    Suppress error messages if QUIET is true. */
 
-void
+static void
 proclaim_decl (decl, quiet)
      tree decl;
      int quiet;
@@ -2555,12 +2418,14 @@ struct path
   struct path *prev;
   tree node;
 };
+
+static tree find_implied_types            PARAMS ((tree, struct path *, tree));
 \f
 /* Look for implied types (enumeral types) implied by TYPE (a decl or type).
    Add these to list.
    Use old_path to guard against cycles. */
 
-tree
+static tree
 find_implied_types (type, old_path, list)
      tree type;
      struct path *old_path;
@@ -2929,7 +2794,7 @@ poplevel (keep, reverse, functionbody)
   tree subblocks;
   tree block = 0;
   tree decl;
-  int block_previously_created;
+  int block_previously_created = 0;
 
   if (current_scope == NULL)
     return error_mark_node;
@@ -3001,7 +2866,6 @@ poplevel (keep, reverse, functionbody)
            }
 
          BLOCK_SUBBLOCKS (block) = subblocks;
-         remember_end_note (block);
        }
 
       /* In each subblock, record that this is its superior.  */
@@ -3040,7 +2904,7 @@ poplevel (keep, reverse, functionbody)
              define_label (input_filename, lineno,
                            DECL_NAME (label));
            }
-         else if (warn_unused && !TREE_USED (label))
+         else if (warn_unused_label && !TREE_USED (label))
            warning_with_decl (label, "label `%s' defined but not used");
          IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
 
@@ -3135,6 +2999,9 @@ set_block (block)
      register tree block;
 {
   current_scope->this_block = block;
+  current_scope->decls = chainon (current_scope->decls, BLOCK_VARS (block));
+  current_scope->blocks = chainon (current_scope->blocks,
+                                  BLOCK_SUBBLOCKS (block));
 }
 \f
 /* Record a decl-node X as belonging to the current lexical scope.
@@ -3149,7 +3016,6 @@ tree
 pushdecl (x)
      tree x;
 {
-  register tree t;
   register tree name = DECL_NAME (x);
   register struct scope *b = current_scope;
 
@@ -3219,7 +3085,7 @@ pushdecl_top_level (x)
 
 tree
 define_label (filename, line, name)
-     char *filename;
+     const char *filename;
      int line;
      tree name;
 {
@@ -3322,9 +3188,10 @@ lookup_name (name)
   return val;
 }
 
+#if 0
 /* Similar to `lookup_name' but look only at current binding level.  */
 
-tree
+static tree
 lookup_name_current_level (name)
      tree name;
 {
@@ -3333,8 +3200,9 @@ lookup_name_current_level (name)
     return val;
   return NULL_TREE;
 }
+#endif
 
-tree
+static tree
 lookup_name_for_seizing (seize_decl)
      tree seize_decl;
 {
@@ -3461,8 +3329,6 @@ init_decl_processing ()
   tree ptr_ftype_luns_ptr_int;
   tree double_ftype_double;
 
-  extern int set_alignment;
-
   /* allow 0-255 enums to occupy only a byte */
   flag_short_enums = 1;
 
@@ -3476,119 +3342,43 @@ init_decl_processing ()
   var_length_id = get_identifier (VAR_LENGTH);
   var_data_id = get_identifier (VAR_DATA);
 
-  /* This is the *C* int type. */
-  integer_type_node = make_signed_type (INT_TYPE_SIZE);
+  build_common_tree_nodes (1);
 
   if (CHILL_INT_IS_SHORT)
     long_integer_type_node = integer_type_node;
   else
     long_integer_type_node = make_signed_type (LONG_TYPE_SIZE);
 
-  unsigned_type_node = make_unsigned_type (INT_TYPE_SIZE);
-  long_unsigned_type_node = make_unsigned_type (LONG_TYPE_SIZE);
-  long_long_integer_type_node = make_signed_type (LONG_LONG_TYPE_SIZE);
-  long_long_unsigned_type_node = make_unsigned_type (LONG_LONG_TYPE_SIZE);
-
   /* `unsigned long' is the standard type for sizeof.
      Note that stddef.h uses `unsigned long',
      and this must agree, even of long and int are the same size.  */
 #ifndef SIZE_TYPE
-    sizetype = long_unsigned_type_node;
+  set_sizetype (long_unsigned_type_node);
 #else
   {
-    char *size_type_c_name = SIZE_TYPE;
+    const char *size_type_c_name = SIZE_TYPE;
     if (strncmp (size_type_c_name, "long long ", 10) == 0)
-      sizetype = long_long_unsigned_type_node;
+      set_sizetype (long_long_unsigned_type_node);
     else if (strncmp (size_type_c_name, "long ", 5) == 0)
-      sizetype = long_unsigned_type_node;
+      set_sizetype (long_unsigned_type_node);
     else
-      sizetype = unsigned_type_node;
+      set_sizetype (unsigned_type_node);
   }
 #endif
 
-  TREE_TYPE (TYPE_SIZE (integer_type_node)) = sizetype;
-  TREE_TYPE (TYPE_SIZE (unsigned_type_node)) = sizetype;
-  TREE_TYPE (TYPE_SIZE (long_unsigned_type_node)) = sizetype;
-  TREE_TYPE (TYPE_SIZE (long_integer_type_node)) = sizetype;
-  TREE_TYPE (TYPE_SIZE (long_long_integer_type_node)) = sizetype;
-  TREE_TYPE (TYPE_SIZE (long_long_unsigned_type_node)) = sizetype;
-
-  error_mark_node = make_node (ERROR_MARK);
-  TREE_TYPE (error_mark_node) = error_mark_node;
-
-  short_integer_type_node = make_signed_type (SHORT_TYPE_SIZE);
-  short_unsigned_type_node = make_unsigned_type (SHORT_TYPE_SIZE);
-  signed_char_type_node = make_signed_type (CHAR_TYPE_SIZE);
-  unsigned_char_type_node = make_unsigned_type (CHAR_TYPE_SIZE);
-  intQI_type_node = make_signed_type (GET_MODE_BITSIZE (QImode));
-  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));
-  intTI_type_node = make_signed_type (GET_MODE_BITSIZE (TImode));
-  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));
-  unsigned_intTI_type_node = make_unsigned_type (GET_MODE_BITSIZE (TImode));
-
-  float_type_node = make_node (REAL_TYPE);
-  TYPE_PRECISION (float_type_node) = FLOAT_TYPE_SIZE;
   pushdecl (build_decl (TYPE_DECL, ridpointers[(int) RID_FLOAT],
                        float_type_node));
-  layout_type (float_type_node);
-
-  double_type_node = make_node (REAL_TYPE);
-  if (flag_short_double)
-    TYPE_PRECISION (double_type_node) = FLOAT_TYPE_SIZE;
-  else
-    TYPE_PRECISION (double_type_node) = DOUBLE_TYPE_SIZE;
   pushdecl (build_decl (TYPE_DECL, ridpointers[(int) RID_DOUBLE],
                        double_type_node));
-  layout_type (double_type_node);
-
-  long_double_type_node = make_node (REAL_TYPE);
-  TYPE_PRECISION (long_double_type_node) = LONG_DOUBLE_TYPE_SIZE;
-  layout_type (long_double_type_node);
-
-  complex_integer_type_node = make_node (COMPLEX_TYPE);
-  TREE_TYPE (complex_integer_type_node) = integer_type_node;
-  layout_type (complex_integer_type_node);
-
-  complex_float_type_node = make_node (COMPLEX_TYPE);
-  TREE_TYPE (complex_float_type_node) = float_type_node;
-  layout_type (complex_float_type_node);
-
-  complex_double_type_node = make_node (COMPLEX_TYPE);
-  TREE_TYPE (complex_double_type_node) = double_type_node;
-  layout_type (complex_double_type_node);
 
-  complex_long_double_type_node = make_node (COMPLEX_TYPE);
-  TREE_TYPE (complex_long_double_type_node) = long_double_type_node;
-  layout_type (complex_long_double_type_node);
+  build_common_tree_nodes_2 (flag_short_double);
 
-  integer_zero_node = build_int_2 (0, 0);
-  TREE_TYPE (integer_zero_node) = integer_type_node;
-  integer_one_node = build_int_2 (1, 0);
-  TREE_TYPE (integer_one_node) = integer_type_node;
-  integer_minus_one_node = build_int_2 (-1, -1);
-  TREE_TYPE (integer_minus_one_node) = integer_type_node;
-
-  size_zero_node = build_int_2 (0, 0);
-  TREE_TYPE (size_zero_node) = sizetype;
-  size_one_node = build_int_2 (1, 0);
-  TREE_TYPE (size_one_node) = sizetype;
-
-  void_type_node = make_node (VOID_TYPE);
   pushdecl (build_decl (TYPE_DECL,
                        ridpointers[(int) RID_VOID], void_type_node));
-  layout_type (void_type_node);        /* Uses integer_zero_node */
   /* 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;
-
-  null_pointer_node = build_int_2 (0, 0);
-  TREE_TYPE (null_pointer_node) = build_pointer_type (void_type_node);
-  layout_type (TREE_TYPE (null_pointer_node));
+  TYPE_USER_ALIGN (void_type_node) = 0;
 
   /* This is for wide string constants.  */
   wchar_type_node = short_unsigned_type_node;
@@ -3633,9 +3423,6 @@ init_decl_processing ()
   bit_one_node = build (CONSTRUCTOR, bitstring_one_type_node, NULL_TREE,
                        build_tree_list (NULL_TREE, integer_zero_node));
 
-  char_type_node = make_node (CHAR_TYPE);
-  TYPE_PRECISION (char_type_node) = CHAR_TYPE_SIZE;
-  fixup_unsigned_type (char_type_node);
   pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_CHAR],
                        char_type_node));
 
@@ -3666,7 +3453,7 @@ init_decl_processing ()
   pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_LONG],
                         long_integer_type_node));
 
-  sizetype = long_integer_type_node;
+  set_sizetype (long_integer_type_node);
 #if 0
   ptrdiff_type_node
     = TREE_TYPE (IDENTIFIER_LOCAL_VALUE (get_identifier (PTRDIFF_TYPE)));
@@ -3698,20 +3485,8 @@ init_decl_processing ()
   DECL_SOURCE_LINE (temp) = 0;
   initializer_type = TREE_TYPE (temp);
 
-  bcopy (chill_tree_code_type,
-         tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
-         (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
-          * sizeof (char)));
-  bcopy (chill_tree_code_length,
-         tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE,
-         (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
-          * sizeof (int)));
-  bcopy (chill_tree_code_name,
-         tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE,
-         (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
-          * sizeof (char *)));
-  boolean_code_name = (char **) xmalloc (sizeof (char *) * (int) LAST_CHILL_TREE_CODE);
-  bzero (boolean_code_name, sizeof (char *) * (int) LAST_CHILL_TREE_CODE);
+  boolean_code_name = (const char **) xcalloc (sizeof (char *),
+                                              (int) LAST_CHILL_TREE_CODE);
 
   boolean_code_name[EQ_EXPR] = "=";
   boolean_code_name[NE_EXPR] = "/=";
@@ -4035,48 +3810,48 @@ init_decl_processing ()
 /* These are compiler-internal function calls, not intended
    to be directly called by user code */
   builtin_function ("__allocate", ptr_ftype_luns_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("_allocate_global_memory", void_ftype_refptr_int_ptr_int, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("_allocate_memory", void_ftype_refptr_int_ptr_int, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__andpowerset", bool_ftype_ptr_ptr_ptr_luns, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__bitsetpowerset", void_ftype_ptr_int_int_int_int, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__cardpowerset", long_ftype_ptr_luns, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__cause_ex1", void_ftype_cptr_cptr_int, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__concatstring", ptr_ftype_ptr_ptr_int_ptr_int, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__continue", void_ftype_ptr_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__diffpowerset", void_ftype_ptr_ptr_ptr_luns, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__eqpowerset", bool_ftype_ptr_ptr_luns, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__ffsetclrpowerset", find_bit_ftype,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__flsetclrpowerset", find_bit_ftype,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__flsetpowerset", int_ftype_ptr_luns_long_ptr_int, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__ffsetpowerset", int_ftype_ptr_luns_long_ptr_int, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__inbitstring", bool_ftype_luns_ptr_luns_long_ptr_int, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__inpowerset", bool_ftype_luns_ptr_luns_long, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__lepowerset", bool_ftype_ptr_ptr_luns, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__ltpowerset", bool_ftype_ptr_ptr_luns, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   /* Currently under experimentation.  */
   builtin_function ("memmove", memcpy_ftype,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("memcmp", memcmp_ftype,
-                    NOT_BUILT_IN, NULL_PTR);
+                    0, NOT_BUILT_IN, NULL_PTR);
 
   /* this comes from c-decl.c (init_decl_processing) */
   builtin_function ("__builtin_alloca",
@@ -4084,40 +3859,40 @@ init_decl_processing ()
                                         tree_cons (NULL_TREE,
                                                    sizetype,
                                                    endlink)),
-                   BUILT_IN_ALLOCA, "alloca");
+                   BUILT_IN_ALLOCA, BUILT_IN_NORMAL, "alloca");
 
   builtin_function ("memset", ptr_ftype_ptr_int_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__notpowerset", bool_ftype_ptr_ptr_luns, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__orpowerset", bool_ftype_ptr_ptr_ptr_luns, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__psslice", void_ftype_ptr_int_ptr_int_int_int, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__pscpy", void_ftype_ptr_luns_luns_cptr_luns_luns_luns,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("_return_memory", void_ftype_ptr_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__setbitpowerset", void_ftype_ptr_luns_long_long_bool_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__terminate", void_ftype_ptr_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__unhandled_ex", void_ftype_cptr_cptr_int, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__xorpowerset", bool_ftype_ptr_ptr_ptr_luns, 
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
 
   /* declare floating point functions */
-  builtin_function ("__sin", double_ftype_double, NOT_BUILT_IN, "sin");
-  builtin_function ("__cos", double_ftype_double, NOT_BUILT_IN, "cos");
-  builtin_function ("__tan", double_ftype_double, NOT_BUILT_IN, "tan");
-  builtin_function ("__asin", double_ftype_double, NOT_BUILT_IN, "asin");
-  builtin_function ("__acos", double_ftype_double, NOT_BUILT_IN, "acos");
-  builtin_function ("__atan", double_ftype_double, NOT_BUILT_IN, "atan");
-  builtin_function ("__exp", double_ftype_double, NOT_BUILT_IN, "exp");
-  builtin_function ("__log", double_ftype_double, NOT_BUILT_IN, "log");
-  builtin_function ("__log10", double_ftype_double, NOT_BUILT_IN, "log10");
-  builtin_function ("__sqrt", double_ftype_double, NOT_BUILT_IN, "sqrt");
+  builtin_function ("__sin", double_ftype_double, 0, NOT_BUILT_IN, "sin");
+  builtin_function ("__cos", double_ftype_double, 0, NOT_BUILT_IN, "cos");
+  builtin_function ("__tan", double_ftype_double, 0, NOT_BUILT_IN, "tan");
+  builtin_function ("__asin", double_ftype_double, 0, NOT_BUILT_IN, "asin");
+  builtin_function ("__acos", double_ftype_double, 0, NOT_BUILT_IN, "acos");
+  builtin_function ("__atan", double_ftype_double, 0, NOT_BUILT_IN, "atan");
+  builtin_function ("__exp", double_ftype_double, 0, NOT_BUILT_IN, "exp");
+  builtin_function ("__log", double_ftype_double, 0, NOT_BUILT_IN, "log");
+  builtin_function ("__log10", double_ftype_double, 0, NOT_BUILT_IN, "log10");
+  builtin_function ("__sqrt", double_ftype_double, 0, NOT_BUILT_IN, "sqrt");
 
   tasking_init ();
   timing_init ();
@@ -4128,114 +3903,114 @@ init_decl_processing ()
      the same names.  Note the lack of a leading underscore. */
   builtin_function ((ignore_case || ! special_UC) ?  "abs" : "ABS",
                    chill_predefined_function_type,
-                   BUILT_IN_CH_ABS, NULL_PTR);
+                   BUILT_IN_CH_ABS, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "abstime" : "ABSTIME",
                    chill_predefined_function_type,
-                   BUILT_IN_ABSTIME, NULL_PTR);
+                   BUILT_IN_ABSTIME, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "allocate" : "ALLOCATE",
                    chill_predefined_function_type,
-                   BUILT_IN_ALLOCATE, NULL_PTR);
+                   BUILT_IN_ALLOCATE, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "allocate_memory" : "ALLOCATE_MEMORY",
                    chill_predefined_function_type,
-                   BUILT_IN_ALLOCATE_MEMORY, NULL_PTR);
+                   BUILT_IN_ALLOCATE_MEMORY, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "addr" : "ADDR",
                    chill_predefined_function_type,
-                   BUILT_IN_ADDR, NULL_PTR);
+                   BUILT_IN_ADDR, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "allocate_global_memory" : "ALLOCATE_GLOBAL_MEMORY",
                    chill_predefined_function_type,
-                   BUILT_IN_ALLOCATE_GLOBAL_MEMORY, NULL_PTR);
+                   BUILT_IN_ALLOCATE_GLOBAL_MEMORY, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "arccos" : "ARCCOS",
                    chill_predefined_function_type,
-                   BUILT_IN_ARCCOS, NULL_PTR);
+                   BUILT_IN_ARCCOS, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "arcsin" : "ARCSIN",
                    chill_predefined_function_type,
-                   BUILT_IN_ARCSIN, NULL_PTR);
+                   BUILT_IN_ARCSIN, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "arctan" : "ARCTAN",
                    chill_predefined_function_type,
-                   BUILT_IN_ARCTAN, NULL_PTR);
+                   BUILT_IN_ARCTAN, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "card" : "CARD",
                    chill_predefined_function_type,
-                   BUILT_IN_CARD, NULL_PTR);
+                   BUILT_IN_CARD, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "cos" : "COS",
                    chill_predefined_function_type,
-                   BUILT_IN_CH_COS, NULL_PTR);
+                   BUILT_IN_CH_COS, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "days" : "DAYS",
                    chill_predefined_function_type,
-                   BUILT_IN_DAYS, NULL_PTR);
+                   BUILT_IN_DAYS, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "descr" : "DESCR",
                    chill_predefined_function_type,
-                   BUILT_IN_DESCR, NULL_PTR);
+                   BUILT_IN_DESCR, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "getstack" : "GETSTACK",
                    chill_predefined_function_type,
-                   BUILT_IN_GETSTACK, NULL_PTR);
+                   BUILT_IN_GETSTACK, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "exp" : "EXP",
                    chill_predefined_function_type,
-                   BUILT_IN_EXP, NULL_PTR);
+                   BUILT_IN_EXP, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "hours" : "HOURS",
                    chill_predefined_function_type,
-                   BUILT_IN_HOURS, NULL_PTR);
+                   BUILT_IN_HOURS, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "inttime" : "INTTIME",
                    chill_predefined_function_type,
-                   BUILT_IN_INTTIME, NULL_PTR);
+                   BUILT_IN_INTTIME, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "length" : "LENGTH",
                    chill_predefined_function_type,
-                   BUILT_IN_LENGTH, NULL_PTR);
+                   BUILT_IN_LENGTH, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "log" : "LOG",
                    chill_predefined_function_type,
-                   BUILT_IN_LOG, NULL_PTR);
+                   BUILT_IN_LOG, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "lower" : "LOWER",
                    chill_predefined_function_type,
-                   BUILT_IN_LOWER, NULL_PTR);
+                   BUILT_IN_LOWER, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "ln" : "LN",
                    chill_predefined_function_type,
-                   BUILT_IN_LN, NULL_PTR);
+                   BUILT_IN_LN, BUILT_IN_NORMAL, NULL_PTR);
   /* Note: these are *not* the C integer MAX and MIN.  They're
      for powerset arguments. */
   builtin_function ((ignore_case || ! special_UC) ?  "max" : "MAX",
                    chill_predefined_function_type,
-                   BUILT_IN_MAX, NULL_PTR);
+                   BUILT_IN_MAX, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "millisecs" : "MILLISECS",
                    chill_predefined_function_type,
-                   BUILT_IN_MILLISECS, NULL_PTR);
+                   BUILT_IN_MILLISECS, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "min" : "MIN",
                    chill_predefined_function_type,
-                   BUILT_IN_MIN, NULL_PTR);
+                   BUILT_IN_MIN, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "minutes" : "MINUTES",
                    chill_predefined_function_type,
-                   BUILT_IN_MINUTES, NULL_PTR);
+                   BUILT_IN_MINUTES, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "num" : "NUM",
                    chill_predefined_function_type,
-                   BUILT_IN_NUM, NULL_PTR);
+                   BUILT_IN_NUM, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "pred" : "PRED",
                    chill_predefined_function_type,
-                   BUILT_IN_PRED, NULL_PTR);
+                   BUILT_IN_PRED, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "return_memory" : "RETURN_MEMORY",
                    chill_predefined_function_type,
-                   BUILT_IN_RETURN_MEMORY, NULL_PTR);
+                   BUILT_IN_RETURN_MEMORY, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "secs" : "SECS",
                    chill_predefined_function_type,
-                   BUILT_IN_SECS, NULL_PTR);
+                   BUILT_IN_SECS, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "sin" : "SIN",
                    chill_predefined_function_type,
-                   BUILT_IN_CH_SIN, NULL_PTR);
+                   BUILT_IN_CH_SIN, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "size" : "SIZE",
                    chill_predefined_function_type,
-                   BUILT_IN_SIZE, NULL_PTR);
+                   BUILT_IN_SIZE, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "sqrt" : "SQRT",
                    chill_predefined_function_type,
-                   BUILT_IN_SQRT, NULL_PTR);
+                   BUILT_IN_SQRT, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "succ" : "SUCC",
                    chill_predefined_function_type,
-                   BUILT_IN_SUCC, NULL_PTR);
+                   BUILT_IN_SUCC, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "tan" : "TAN",
                    chill_predefined_function_type,
-                   BUILT_IN_TAN, NULL_PTR);
+                   BUILT_IN_TAN, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "terminate" : "TERMINATE",
                    chill_predefined_function_type,
-                   BUILT_IN_TERMINATE, NULL_PTR);
+                   BUILT_IN_TERMINATE, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ?  "upper" : "UPPER",
                    chill_predefined_function_type,
-                   BUILT_IN_UPPER, NULL_PTR);
+                   BUILT_IN_UPPER, BUILT_IN_NORMAL, NULL_PTR);
 
   build_chill_descr_type ();
   build_chill_inttime_type ();
@@ -4256,29 +4031,22 @@ init_decl_processing ()
    the name to be called if we can't opencode the function.  */
 
 tree
-builtin_function (name, type, function_code, library_name)
-     char *name;
+builtin_function (name, type, function_code, class, library_name)
+     const char *name;
      tree type;
-     enum built_in_function function_code;
-     char *library_name;
+     int function_code;
+     enum built_in_class class;
+     const char *library_name;
 {
   tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
   DECL_EXTERNAL (decl) = 1;
   TREE_PUBLIC (decl) = 1;
-  /* If -traditional, permit redefining a builtin function any way you like.
-     (Though really, if the program redefines these functions,
-     it probably won't work right unless compiled with -fno-builtin.)  */
-  if (flag_traditional && name[0] != '_')
-    DECL_BUILT_IN_NONANSI (decl) = 1;
   if (library_name)
     DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
   make_decl_rtl (decl, NULL_PTR, 1);
   pushdecl (decl);
-  if (function_code != NOT_BUILT_IN)
-    {
-      DECL_BUILT_IN (decl) = 1;
-      DECL_SET_FUNCTION_CODE (decl, function_code);
-    }
+  DECL_BUILT_IN_CLASS (decl) = class;
+  DECL_FUNCTION_CODE (decl) = function_code;
 
   return decl;
 }
@@ -4306,7 +4074,6 @@ void
 finish_decl (decl)
      tree decl;
 {
-  register tree type = TREE_TYPE (decl);
   int was_incomplete = (DECL_SIZE (decl) == 0);
   int temporary = allocation_temporary_p ();
 
@@ -4411,7 +4178,7 @@ finish_decl (decl)
 
 tree
 maybe_build_cleanup (decl)
-     tree decl;
+     tree decl ATTRIBUTE_UNUSED;
 {
   /* There are no cleanups in C.  */
   return NULL_TREE;
@@ -4423,8 +4190,8 @@ maybe_build_cleanup (decl)
 
 int
 complete_array_type (type, initial_value, do_default)
-     tree type, initial_value;
-     int do_default;
+     tree type ATTRIBUTE_UNUSED, initial_value ATTRIBUTE_UNUSED;
+     int do_default ATTRIBUTE_UNUSED;
 {
   /* Only needed so we can link with ../c-typeck.c. */
   abort ();
@@ -4440,7 +4207,7 @@ complete_array_type (type, initial_value, do_default)
 tree
 start_struct (code, name)
      enum chill_tree_code code;
-     tree name;
+     tree name ATTRIBUTE_UNUSED;
 {
   /* If there is already a tag defined at this binding level
      (as a forward reference), just return it.  */
@@ -4479,18 +4246,9 @@ finish_struct (t, fieldlist)
 {
   register tree x;
 
-  /* Install struct as DECL_CONTEXT of each field decl.
-     Also process specified field sizes.
-     Set DECL_FIELD_SIZE to the specified size, or 0 if none specified.
-     The specified size is found in the DECL_INITIAL.
-     Store 0 there, except for ": 0" fields (so we can find them
-     and delete them, below).  */
-
+  /* Install struct as DECL_CONTEXT of each field decl.  */
   for (x = fieldlist; x; x = TREE_CHAIN (x))
-    {
-      DECL_CONTEXT (x) = t;
-      DECL_FIELD_SIZE (x) = 0;
-    }
+    DECL_CONTEXT (x) = t;
 
   TYPE_FIELDS (t) = fieldlist;
 
@@ -4524,7 +4282,7 @@ layout_array_type (t)
 
 tree
 start_enum (name)
-     tree name;
+     tree name ATTRIBUTE_UNUSED;
 {
   register tree enumtype;
 
@@ -4634,7 +4392,7 @@ layout_enum (enumtype)
              constant_expression_warning (value);
              if (tree_int_cst_lt (value, integer_zero_node))
                {
-                 error ("enumerator value for `%s' is less then 0",
+                 error ("enumerator value for `%s' is less than 0",
                         IDENTIFIER_POINTER (DECL_NAME (decl)));
                  value = error_mark_node;
                }
@@ -4682,7 +4440,7 @@ layout_enum (enumtype)
     }
 
   /* Fix all error_mark_nodes in enum. Increment maxnode and assign value.
-     This is neccessary to make a duplicate value check in the enum */
+     This is necessary to make a duplicate value check in the enum */
   for (pair = values; pair; pair = TREE_CHAIN (pair))
     {
       tree decl = TREE_VALUE (pair);
@@ -4749,8 +4507,11 @@ layout_enum (enumtype)
   for (pair = values; pair; pair = TREE_CHAIN (pair))
     {
       tree decl = TREE_VALUE (pair);
+
       DECL_SIZE (decl) = TYPE_SIZE (enumtype);
+      DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (enumtype);
       DECL_ALIGN (decl) = TYPE_ALIGN (enumtype);
+      DECL_USER_ALIGN (decl) = TYPE_USER_ALIGN (enumtype);
 
       /* Set the TREE_VALUE to the name, rather than the decl,
         since that is what the rest of the compiler expects. */
@@ -4767,6 +4528,7 @@ layout_enum (enumtype)
       TYPE_MODE (tem) = TYPE_MODE (enumtype);
       TYPE_PRECISION (tem) = TYPE_PRECISION (enumtype);
       TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype);
+      TYPE_USER_ALIGN (tem) = TYPE_USER_ALIGN (enumtype);
       TREE_UNSIGNED (tem) = TREE_UNSIGNED (enumtype);
     }
 
@@ -4818,7 +4580,7 @@ build_enumerator (name, value)
       if (!unnamed_value_warned)
        {
          unnamed_value_warned = 1;
-         warning ("undefined value in SET mode is obsolete and deprecated.");
+         warning ("undefined value in SET mode is obsolete and deprecated");
        }
       sprintf (buf, "__star_%d", next_dummy_enum_value++);
       name = get_identifier (buf);
@@ -4970,7 +4732,7 @@ save_expr_under_name (name, expr)
   pushdecllist (alias, 0);
 }
 
-void
+static void
 do_based_decl (name, mode, base_var)
      tree name, mode, base_var;
 {
@@ -5061,8 +4823,6 @@ void
 shadow_record_fields (struct_val)
      tree struct_val;
 {
-    tree type, parent;
-
     if (pass == 1 || struct_val == NULL_TREE)
       return;
 
@@ -5073,7 +4833,7 @@ static char exception_prefix [] = "__Ex_";
 
 tree
 build_chill_exception_decl (name)
-     char *name;
+     const char *name;
 {
   tree decl, ex_name, ex_init, ex_type;
   int  name_len = strlen (name);
@@ -5134,7 +4894,7 @@ finish_outer_function ()
      and fill in the module's function's address. */
 
   extern tree initializer_type;
-  char *fname_str = IDENTIFIER_POINTER (DECL_NAME (current_function_decl));
+  const char *fname_str = IDENTIFIER_POINTER (DECL_NAME (current_function_decl));
   char *init_entry_name = (char *)xmalloc ((unsigned)(strlen (fname_str) + 20));
   tree  init_entry_id;
   tree  init_entry_decl;