On Thu, 2009-06-25 at 15:28 -0700, Ian Lance Taylor wrote:
> Richard Guenther <richard.guent...@gmail.com> writes:
> 
> >> I guess this has to do with reserved word conflict on "new":
> >>
> >> <<
> >> tree
> >> substitute_in_type (tree t, tree f, tree r)
> >> {
> >>  tree new;
> >>>>
> >>
> >> Do you have some way to deal with this?
> >
> > Use a non-reserved identifier.  I guess on trunk Ada doesn't build
> > with -Wc++-compat, does it?
> 
> Interesting.  I've been testing my -Wc++-compat patches with full
> bootstraps including Ada, but I just looked at my make log and it does
> indeed appear that -Wc++-compat doesn't make it onto the Ada files.
> 
> It seems to be because of this line in ada/gcc-interface/Make-lang.in:
> 
> ada-warn = $(ADA_CFLAGS) $(WERROR)
> 
> The other languages use
> 
> DIR-warn = $(STRICT_WARN)
> 
> which is what brings in -Wc++-compat.

What is the way forward: fixing in some way the Ada Makefile? Or doing
search and replace in case of keyword/identifier conflict? If
search/replace, do AdaCore people have an opinion on the best way
to proceed to avoid maintenance issues in the various trees? (eg: commit
of those trivial patches directly on trunk or on AdaCore tree then
trunk?)

I don't know much about C++/C compatibilities and the way to solve
them choosen on the gcc-in-cxx branch, is there a document somewhere?

Next error is related to enum in for loop:

g++ -c  -g -g -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual
-fno-common  -DHAVE_CONFIG_H -I.. -I. -Iada -I../../gcc/gcc
-I../../gcc/gcc/ada -I../../gcc/gcc/../include
-I../../gcc/gcc/../libcpp/include -I/opt/cfarm/gmp-4.2.4//include
-I/opt/cfarm/mpfr-2.4.1//include -I../../gcc/gcc/../libdecnumber
-I../../gcc/gcc/../libdecnumber/bid
-I../libdecnumber    ../../gcc/gcc/ada/gcc-interface/misc.c -o
ada/misc.o
../../gcc/gcc/ada/gcc-interface/misc.c: In function 'void
enumerate_modes(void (*)(int, int, int, int, int, int, unsigned int))':
../../gcc/gcc/ada/gcc-interface/misc.c:734: error: invalid conversion
from 'int' to 'machine_mode'
../../gcc/gcc/ada/gcc-interface/misc.c:734: error: no 'operator++(int)'
declared for postfix '++', trying prefix operator instead
../../gcc/gcc/ada/gcc-interface/misc.c:734: error: no match for
'operator++' in '++i'

<<
void
enumerate_modes (void (*f) (int, int, int, int, int, int, unsigned int))
{
  enum machine_mode i;

  for (i = 0; i < NUM_MACHINE_MODES; i++)
>>

Another kind of error on struct declarations:

<<
g++ -c  -g -g -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual
-fno-common  -DHAVE_CONFIG_H -I.. -I. -Iada -I../../gcc/gcc
-I../../gcc/gcc/ada -I../../gcc/gcc/../include
-I../../gcc/gcc/../libcpp/include -I/opt/cfarm/gmp-4.2.4//include
-I/opt/cfarm/mpfr-2.4.1//include -I../../gcc/gcc/../libdecnumber
-I../../gcc/gcc/../libdecnumber/bid
-I../libdecnumber    ../../gcc/gcc/ada/gcc-interface/trans.c -o
ada/trans.o
../../gcc/gcc/ada/gcc-interface/trans.c:111: error: conflicting
declaration 'typedef struct parm_attr* parm_attr'
../../gcc/gcc/ada/gcc-interface/trans.c:103: error: 'struct parm_attr'
has a previous declaration as 'struct parm_attr'
>>

Last error is on void* arithmetic:

<<
g++ -c  -g -g -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual
-fno-common -Wno-error -DHAVE_CONFIG_H  -I. -Iada -I../../gcc/gcc
-I../../gcc/gcc/ada -I../../gcc/gcc/../include
-I../../gcc/gcc/../libcpp/include -I/opt/cfarm/gmp-4.2.4//include
-I/opt/cfarm/mpfr-2.4.1//include -I../../gcc/gcc/../libdecnumber
-I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber    \
              -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada
-I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include
-I/opt/cfarm/gmp-4.2.4//include -I/opt/cfarm/mpfr-2.4.1//include
-I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid
-I../libdecnumber   -fno-omit-frame-pointer ../../gcc/gcc/ada/tracebak.c
-o ada/tracebak.o
In file included from ../../gcc/gcc/ada/tracebak.c:396:
../../gcc/gcc/ada/tb-gcc.c: In function '_Unwind_Reason_Code
trace_callback(_Unwind_Context*, uw_data_t*)':
../../gcc/gcc/ada/tb-gcc.c:86: error: pointer of type 'void *' used in
arithmetic
>>

Patch welcomed as these three are not obvious to me :).

I did "touch xx.o" to get past and with the quick search/replace
of new/class/template patch below it then tried to link libbackend.o.

Thanks in advance,

Laurent

Index: gcc/ada/gcc-interface/utils.c
===================================================================
--- gcc/ada/gcc-interface/utils.c       (revision 148953)
+++ gcc/ada/gcc-interface/utils.c       (working copy)
@@ -1014,33 +1014,33 @@
             bool has_rep)
 {
   tree type = TREE_TYPE (last_size);
-  tree new;
+  tree new_tree;
 
   if (!special || TREE_CODE (size) != COND_EXPR)
     {
-      new = size_binop (PLUS_EXPR, first_bit, size);
+      new_tree = size_binop (PLUS_EXPR, first_bit, size);
       if (has_rep)
-       new = size_binop (MAX_EXPR, last_size, new);
+       new_tree = size_binop (MAX_EXPR, last_size, new_tree);
     }
 
   else
-    new = fold_build3 (COND_EXPR, type, TREE_OPERAND (size, 0),
-                      integer_zerop (TREE_OPERAND (size, 1))
-                      ? last_size : merge_sizes (last_size, first_bit,
-                                                 TREE_OPERAND (size, 1),
-                                                 1, has_rep),
-                      integer_zerop (TREE_OPERAND (size, 2))
-                      ? last_size : merge_sizes (last_size, first_bit,
-                                                 TREE_OPERAND (size, 2),
-                                                 1, has_rep));
+    new_tree = fold_build3 (COND_EXPR, type, TREE_OPERAND (size, 0),
+                           integer_zerop (TREE_OPERAND (size, 1))
+                           ? last_size : merge_sizes (last_size, first_bit,
+                                                 TREE_OPERAND (size, 1),
+                                                 1, has_rep),
+                           integer_zerop (TREE_OPERAND (size, 2))
+                           ? last_size : merge_sizes (last_size, first_bit,
+                                                 TREE_OPERAND (size, 2),
+                                                 1, has_rep));
 
   /* We don't need any NON_VALUE_EXPRs and they can confuse us (especially
      when fed through substitute_in_expr) into thinking that a constant
      size is not constant.  */
-  while (TREE_CODE (new) == NON_LVALUE_EXPR)
-    new = TREE_OPERAND (new, 0);
+  while (TREE_CODE (new_tree) == NON_LVALUE_EXPR)
+    new_tree = TREE_OPERAND (new_tree, 0);
 
-  return new;
+  return new_tree;
 }
 
 /* Utility function of above to see if OP0 and OP1, both of SIZETYPE, are
@@ -1160,18 +1160,18 @@
 tree
 copy_type (tree type)
 {
-  tree new = copy_node (type);
+  tree new_tree = copy_node (type);
 
   /* copy_node clears this field instead of copying it, because it is
      aliased with TREE_CHAIN.  */
-  TYPE_STUB_DECL (new) = TYPE_STUB_DECL (type);
+  TYPE_STUB_DECL (new_tree) = TYPE_STUB_DECL (type);
 
-  TYPE_POINTER_TO (new) = 0;
-  TYPE_REFERENCE_TO (new) = 0;
-  TYPE_MAIN_VARIANT (new) = new;
-  TYPE_NEXT_VARIANT (new) = 0;
+  TYPE_POINTER_TO (new_tree) = 0;
+  TYPE_REFERENCE_TO (new_tree) = 0;
+  TYPE_MAIN_VARIANT (new_tree) = new_tree;
+  TYPE_NEXT_VARIANT (new_tree) = 0;
 
-  return new;
+  return new_tree;
 }
 
 /* Return a subtype of sizetype with range MIN to MAX and whose
@@ -2512,7 +2512,7 @@
   tree record_type = make_node (RECORD_TYPE);
   tree pointer32_type;
   tree field_list = 0;
-  int class;
+  int class_i;
   int dtype = 0;
   tree inner_type;
   int ndim;
@@ -2624,22 +2624,22 @@
     {
     case By_Descriptor_A:
     case By_Short_Descriptor_A:
-      class = 4;
+      class_i = 4;
       break;
     case By_Descriptor_NCA:
     case By_Short_Descriptor_NCA:
-      class = 10;
+      class_i = 10;
       break;
     case By_Descriptor_SB:
     case By_Short_Descriptor_SB:
-      class = 15;
+      class_i = 15;
       break;
     case By_Descriptor:
     case By_Short_Descriptor:
     case By_Descriptor_S:
     case By_Short_Descriptor_S:
     default:
-      class = 1;
+      class_i = 1;
       break;
     }
 
@@ -2661,7 +2661,7 @@
   field_list = chainon (field_list,
                        make_descriptor_field ("CLASS",
                                               gnat_type_for_size (8, 1),
-                                              record_type, size_int (class)));
+                                              record_type, size_int 
(class_i)));
 
   /* Of course this will crash at run-time if the address space is not
      within the low 32 bits, but there is nothing else we can do.  */
@@ -2827,7 +2827,7 @@
   tree record64_type = make_node (RECORD_TYPE);
   tree pointer64_type;
   tree field_list64 = 0;
-  int class;
+  int class_i;
   int dtype = 0;
   tree inner_type;
   int ndim;
@@ -2938,18 +2938,18 @@
   switch (mech)
     {
     case By_Descriptor_A:
-      class = 4;
+      class_i = 4;
       break;
     case By_Descriptor_NCA:
-      class = 10;
+      class_i = 10;
       break;
     case By_Descriptor_SB:
-      class = 15;
+      class_i = 15;
       break;
     case By_Descriptor:
     case By_Descriptor_S:
     default:
-      class = 1;
+      class_i = 1;
       break;
     }
 
@@ -2968,7 +2968,7 @@
   field_list64 = chainon (field_list64,
                        make_descriptor_field ("CLASS",
                                               gnat_type_for_size (8, 1),
-                                              record64_type, size_int 
(class)));
+                                              record64_type, size_int 
(class_i)));
 
   field_list64 = chainon (field_list64,
                        make_descriptor_field ("MBMO",
@@ -3151,9 +3151,9 @@
   tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
   tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
   /* The CLASS field is the 3rd field in the descriptor.  */
-  tree class = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
+  tree class_tree = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
   /* The POINTER field is the 6th field in the descriptor.  */
-  tree pointer64 = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (class)));
+  tree pointer64 = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (class_tree)));
 
   /* Retrieve the value of the POINTER field.  */
   tree gnu_expr64
@@ -3169,9 +3169,9 @@
       tree template_type = TREE_TYPE (p_bounds_type);
       tree min_field = TYPE_FIELDS (template_type);
       tree max_field = TREE_CHAIN (TYPE_FIELDS (template_type));
-      tree template, template_addr, aflags, dimct, t, u;
+      tree template_tree, template_addr, aflags, dimct, t, u;
       /* See the head comment of build_vms_descriptor.  */
-      int iclass = TREE_INT_CST_LOW (DECL_INITIAL (class));
+      int iclass = TREE_INT_CST_LOW (DECL_INITIAL (class_tree));
       tree lfield, ufield;
 
       /* Convert POINTER to the type of the P_ARRAY field.  */
@@ -3182,23 +3182,23 @@
        case 1:  /* Class S  */
        case 15: /* Class SB */
          /* Build {1, LENGTH} template; LENGTH64 is the 5th field.  */
-         t = TREE_CHAIN (TREE_CHAIN (class));
+         t = TREE_CHAIN (TREE_CHAIN (class_tree));
          t = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
          t = tree_cons (min_field,
                         convert (TREE_TYPE (min_field), integer_one_node),
                         tree_cons (max_field,
                                    convert (TREE_TYPE (max_field), t),
                                    NULL_TREE));
-         template = gnat_build_constructor (template_type, t);
-         template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template);
+         template_tree = gnat_build_constructor (template_type, t);
+         template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template_tree);
 
          /* For class S, we are done.  */
          if (iclass == 1)
            break;
 
          /* Test that we really have a SB descriptor, like DEC Ada.  */
-         t = build3 (COMPONENT_REF, TREE_TYPE (class), desc, class, NULL);
-         u = convert (TREE_TYPE (class), DECL_INITIAL (class));
+         t = build3 (COMPONENT_REF, TREE_TYPE (class_tree), desc, class_tree, 
NULL);
+         u = convert (TREE_TYPE (class_tree), DECL_INITIAL (class_tree));
          u = build_binary_op (EQ_EXPR, integer_type_node, t, u);
          /* If so, there is already a template in the descriptor and
             it is located right after the POINTER field.  The fields are
@@ -3216,12 +3216,12 @@
          t = tree_cons (TYPE_FIELDS (template_type), lfield,
                         tree_cons (TREE_CHAIN (TYPE_FIELDS (template_type)),
                                     ufield, NULL_TREE));
-         template = gnat_build_constructor (template_type, t);
+         template_tree = gnat_build_constructor (template_type, t);
 
          /* Otherwise use the {1, LENGTH} template we build above.  */
          template_addr = build3 (COND_EXPR, p_bounds_type, u,
                                  build_unary_op (ADDR_EXPR, p_bounds_type,
-                                                template),
+                                                template_tree),
                                  template_addr);
          break;
 
@@ -3263,12 +3263,12 @@
          t = tree_cons (TYPE_FIELDS (template_type), lfield,
                         tree_cons (TREE_CHAIN (TYPE_FIELDS (template_type)),
                                     ufield, NULL_TREE));
-         template = gnat_build_constructor (template_type, t);
-         template = build3 (COND_EXPR, p_bounds_type, u,
+         template_tree = gnat_build_constructor (template_type, t);
+         template_tree = build3 (COND_EXPR, p_bounds_type, u,
                            build_call_raise (CE_Length_Check_Failed, Empty,
                                              N_Raise_Constraint_Error),
-                           template);
-         template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template);
+                           template_tree);
+         template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, 
template_tree);
          break;
 
        case 10: /* Class NCA */
@@ -3299,9 +3299,9 @@
   tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
   tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
   /* The CLASS field is the 3rd field in the descriptor.  */
-  tree class = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
+  tree class_tree = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
   /* The POINTER field is the 4th field in the descriptor.  */
-  tree pointer = TREE_CHAIN (class);
+  tree pointer = TREE_CHAIN (class_tree);
 
   /* Retrieve the value of the POINTER field.  */
   tree gnu_expr32
@@ -3317,9 +3317,9 @@
       tree template_type = TREE_TYPE (p_bounds_type);
       tree min_field = TYPE_FIELDS (template_type);
       tree max_field = TREE_CHAIN (TYPE_FIELDS (template_type));
-      tree template, template_addr, aflags, dimct, t, u;
+      tree template_tree, template_addr, aflags, dimct, t, u;
       /* See the head comment of build_vms_descriptor.  */
-      int iclass = TREE_INT_CST_LOW (DECL_INITIAL (class));
+      int iclass = TREE_INT_CST_LOW (DECL_INITIAL (class_tree));
 
       /* Convert POINTER to the type of the P_ARRAY field.  */
       gnu_expr32 = convert (p_array_type, gnu_expr32);
@@ -3336,25 +3336,25 @@
                         tree_cons (max_field,
                                    convert (TREE_TYPE (max_field), t),
                                    NULL_TREE));
-         template = gnat_build_constructor (template_type, t);
-         template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template);
+         template_tree = gnat_build_constructor (template_type, t);
+         template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template_tree);
 
          /* For class S, we are done.  */
          if (iclass == 1)
            break;
 
          /* Test that we really have a SB descriptor, like DEC Ada.  */
-         t = build3 (COMPONENT_REF, TREE_TYPE (class), desc, class, NULL);
-         u = convert (TREE_TYPE (class), DECL_INITIAL (class));
+         t = build3 (COMPONENT_REF, TREE_TYPE (class_tree), desc, class_tree, 
NULL);
+         u = convert (TREE_TYPE (class_tree), DECL_INITIAL (class_tree));
          u = build_binary_op (EQ_EXPR, integer_type_node, t, u);
          /* If so, there is already a template in the descriptor and
             it is located right after the POINTER field.  */
          t = TREE_CHAIN (pointer);
-         template = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+         template_tree = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, 
NULL_TREE);
          /* Otherwise use the {1, LENGTH} template we build above.  */
          template_addr = build3 (COND_EXPR, p_bounds_type, u,
                                  build_unary_op (ADDR_EXPR, p_bounds_type,
-                                                template),
+                                                template_tree),
                                  template_addr);
          break;
 
@@ -3381,12 +3381,12 @@
          /* There is already a template in the descriptor and it is
             located at the start of block 3 (12th field).  */
          t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (t))));
-         template = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
-         template = build3 (COND_EXPR, p_bounds_type, u,
+         template_tree = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, 
NULL_TREE);
+         template_tree = build3 (COND_EXPR, p_bounds_type, u,
                            build_call_raise (CE_Length_Check_Failed, Empty,
                                              N_Raise_Constraint_Error),
-                           template);
-         template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template);
+                           template_tree);
+         template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, 
template_tree);
          break;
 
        case 10: /* Class NCA */
@@ -3717,7 +3717,7 @@
   tree template_type = TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type))));
   tree p_array_type = TREE_TYPE (TYPE_FIELDS (type));
   tree etype = TREE_TYPE (expr);
-  tree template;
+  tree template_tree;
 
   /* If EXPR is null, make a fat pointer that contains null pointers to the
      template and array.  */
@@ -3743,7 +3743,7 @@
       else
        expr = build1 (INDIRECT_REF, TREE_TYPE (etype), expr);
 
-      template = build_component_ref (expr, NULL_TREE, fields, false);
+      template_tree = build_component_ref (expr, NULL_TREE, fields, false);
       expr = build_unary_op (ADDR_EXPR, NULL_TREE,
                             build_component_ref (expr, NULL_TREE,
                                                  TREE_CHAIN (fields), false));
@@ -3751,7 +3751,7 @@
 
   /* Otherwise, build the constructor for the template.  */
   else
-    template = build_template (template_type, TREE_TYPE (etype), expr);
+    template_tree = build_template (template_type, TREE_TYPE (etype), expr);
 
   /* The final result is a constructor for the fat pointer.
 
@@ -3771,7 +3771,7 @@
        tree_cons (TYPE_FIELDS (type),
                  convert (p_array_type, expr),
                  tree_cons (TREE_CHAIN (TYPE_FIELDS (type)),
-                            build_unary_op (ADDR_EXPR, NULL_TREE, template),
+                            build_unary_op (ADDR_EXPR, NULL_TREE, 
template_tree),
                             NULL_TREE)));
 }
 
@@ -4301,20 +4301,20 @@
 maybe_unconstrained_array (tree exp)
 {
   enum tree_code code = TREE_CODE (exp);
-  tree new;
+  tree new_tree;
 
   switch (TREE_CODE (TREE_TYPE (exp)))
     {
     case UNCONSTRAINED_ARRAY_TYPE:
       if (code == UNCONSTRAINED_ARRAY_REF)
        {
-         new
+         new_tree
            = build_unary_op (INDIRECT_REF, NULL_TREE,
                              build_component_ref (TREE_OPERAND (exp, 0),
                                                   get_identifier ("P_ARRAY"),
                                                   NULL_TREE, false));
-         TREE_READONLY (new) = TREE_STATIC (new) = TREE_READONLY (exp);
-         return new;
+         TREE_READONLY (new_tree) = TREE_STATIC (new_tree) = TREE_READONLY 
(exp);
+         return new_tree;
        }
 
       else if (code == NULL_EXPR)
@@ -4328,12 +4328,12 @@
         it contains a template.  */
       if (TYPE_IS_PADDING_P (TREE_TYPE (exp)))
        {
-         new = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp);
-         if (TREE_CODE (TREE_TYPE (new)) == RECORD_TYPE
-             && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (new)))
+         new_tree = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp);
+         if (TREE_CODE (TREE_TYPE (new_tree)) == RECORD_TYPE
+             && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (new_tree)))
            return
-             build_component_ref (new, NULL_TREE,
-                                  TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (new))),
+             build_component_ref (new_tree, NULL_TREE,
+                                  TREE_CHAIN (TYPE_FIELDS (TREE_TYPE 
(new_tree))),
                                   0);
        }
       else if (TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (exp)))
Index: gcc/ada/gcc-interface/decl.c
===================================================================
--- gcc/ada/gcc-interface/decl.c        (revision 148953)
+++ gcc/ada/gcc-interface/decl.c        (working copy)
@@ -7788,7 +7788,7 @@
 tree
 substitute_in_type (tree t, tree f, tree r)
 {
-  tree new;
+  tree new_tree;
 
   gcc_assert (CONTAINS_PLACEHOLDER_P (r));
 
@@ -7809,15 +7809,15 @@
          if (low == TYPE_GCC_MIN_VALUE (t) && high == TYPE_GCC_MAX_VALUE (t))
            return t;
 
-         new = copy_type (t);
-         TYPE_GCC_MIN_VALUE (new) = low;
-         TYPE_GCC_MAX_VALUE (new) = high;
+         new_tree = copy_type (t);
+         TYPE_GCC_MIN_VALUE (new_tree) = low;
+         TYPE_GCC_MAX_VALUE (new_tree) = high;
 
          if (TREE_CODE (t) == INTEGER_TYPE && TYPE_INDEX_TYPE (t))
            SET_TYPE_INDEX_TYPE
-             (new, substitute_in_type (TYPE_INDEX_TYPE (t), f, r));
+             (new_tree, substitute_in_type (TYPE_INDEX_TYPE (t), f, r));
 
-         return new;
+         return new_tree;
        }
 
       /* Then the subtypes.  */
@@ -7830,21 +7830,21 @@
          if (low == TYPE_RM_MIN_VALUE (t) && high == TYPE_RM_MAX_VALUE (t))
            return t;
 
-         new = copy_type (t);
-         SET_TYPE_RM_MIN_VALUE (new, low);
-         SET_TYPE_RM_MAX_VALUE (new, high);
+         new_tree = copy_type (t);
+         SET_TYPE_RM_MIN_VALUE (new_tree, low);
+         SET_TYPE_RM_MAX_VALUE (new_tree, high);
 
-         return new;
+         return new_tree;
        }
 
       return t;
 
     case COMPLEX_TYPE:
-      new = substitute_in_type (TREE_TYPE (t), f, r);
-      if (new == TREE_TYPE (t))
+      new_tree = substitute_in_type (TREE_TYPE (t), f, r);
+      if (new_tree == TREE_TYPE (t))
        return t;
 
-      return build_complex_type (new);
+      return build_complex_type (new_tree);
 
     case OFFSET_TYPE:
     case METHOD_TYPE:
@@ -7861,16 +7861,16 @@
        if (component == TREE_TYPE (t) && domain == TYPE_DOMAIN (t))
          return t;
 
-       new = build_array_type (component, domain);
-       TYPE_ALIGN (new) = TYPE_ALIGN (t);
-       TYPE_USER_ALIGN (new) = TYPE_USER_ALIGN (t);
-       SET_TYPE_MODE (new, TYPE_MODE (t));
-       TYPE_SIZE (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
-       TYPE_SIZE_UNIT (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, r);
-       TYPE_NONALIASED_COMPONENT (new) = TYPE_NONALIASED_COMPONENT (t);
-       TYPE_MULTI_ARRAY_P (new) = TYPE_MULTI_ARRAY_P (t);
-       TYPE_CONVENTION_FORTRAN_P (new) = TYPE_CONVENTION_FORTRAN_P (t);
-       return new;
+       new_tree = build_array_type (component, domain);
+       TYPE_ALIGN (new_tree) = TYPE_ALIGN (t);
+       TYPE_USER_ALIGN (new_tree) = TYPE_USER_ALIGN (t);
+       SET_TYPE_MODE (new_tree, TYPE_MODE (t));
+       TYPE_SIZE (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
+       TYPE_SIZE_UNIT (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, 
r);
+       TYPE_NONALIASED_COMPONENT (new_tree) = TYPE_NONALIASED_COMPONENT (t);
+       TYPE_MULTI_ARRAY_P (new_tree) = TYPE_MULTI_ARRAY_P (t);
+       TYPE_CONVENTION_FORTRAN_P (new_tree) = TYPE_CONVENTION_FORTRAN_P (t);
+       return new_tree;
       }
 
     case RECORD_TYPE:
@@ -7883,8 +7883,8 @@
        /* Start out with no fields, make new fields, and chain them
           in.  If we haven't actually changed the type of any field,
           discard everything we've done and return the old type.  */
-       new = copy_type (t);
-       TYPE_FIELDS (new) = NULL_TREE;
+       new_tree = copy_type (t);
+       TYPE_FIELDS (new_tree) = NULL_TREE;
 
        for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
          {
@@ -7915,23 +7915,23 @@
                  }
              }
 
-           DECL_CONTEXT (new_field) = new;
+           DECL_CONTEXT (new_field) = new_tree;
            SET_DECL_ORIGINAL_FIELD (new_field,
                                     (DECL_ORIGINAL_FIELD (field)
                                      ? DECL_ORIGINAL_FIELD (field) : field));
 
-           TREE_CHAIN (new_field) = TYPE_FIELDS (new);
-           TYPE_FIELDS (new) = new_field;
+           TREE_CHAIN (new_field) = TYPE_FIELDS (new_tree);
+           TYPE_FIELDS (new_tree) = new_field;
          }
 
        if (!changed_field)
          return t;
 
-       TYPE_FIELDS (new) = nreverse (TYPE_FIELDS (new));
-       TYPE_SIZE (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
-       TYPE_SIZE_UNIT (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, r);
-       SET_TYPE_ADA_SIZE (new, SUBSTITUTE_IN_EXPR (TYPE_ADA_SIZE (t), f, r));
-       return new;
+       TYPE_FIELDS (new_tree) = nreverse (TYPE_FIELDS (new_tree));
+       TYPE_SIZE (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
+       TYPE_SIZE_UNIT (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, 
r);
+       SET_TYPE_ADA_SIZE (new_tree, SUBSTITUTE_IN_EXPR (TYPE_ADA_SIZE (t), f, 
r));
+       return new_tree;
       }
 
     default:

Reply via email to