This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH INSTALLED]: Eliminate "new" keyword from FORTRAN dir


This patch removes the "new" macro from gfortran.h and updates all the
locations in the fortran directory where this keyword is used.  Where
appropriate I used the new "gfc_new" structure member.  In other cases
like local variables, I ususally used new_foo, where "foo" is some
descriptive term like "expr" or "code" or whatever the underlying type of
the local variable was.

Patch tested on x86_64-unknown-linux-gnu, no regressions.

Installed on mainline, preapproved by Tobias Burnus:
http://gcc.gnu.org/ml/fortran/2008-07/msg00118.html

		--Kaveh


2008-07-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* gfortran.h (new): Remove macro.
	* array.c (gfc_append_constructor, match_array_list,
	gfc_match_array_constructor): Likewise.
	* bbt.c (insert, gfc_insert_bbt): Likewise.
	* decl.c (var_element, top_var_list, top_val_list, gfc_match_data,
	get_proc_name): Likewise.
	* expr.c (gfc_copy_actual_arglist): Likewise.
	* interface.c (compare_actual_formal, check_new_interface,
	gfc_add_interface): Likewise.
	* intrinsic.c gfc_convert_type_warn, gfc_convert_chartype):
	Likewise.
	* io.c (match_io_iterator, match_io_list): Likewise.
	* match.c (match_forall_header): Likewise.
	* matchexp.c (build_node): Likewise.
	* module.c (gfc_match_use): Likewise.
	* scanner.c (load_file): Likewise.
	* st.c (gfc_append_code): Likewise.
	* symbol.c (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols,
	gfc_commit_symbols): Likewise.
	* trans-common.c (build_field): Likewise.
	* trans-decl.c (gfc_finish_var_decl): Likewise.
	* trans-expr.c (gfc_free_interface_mapping,
	gfc_get_interface_mapping_charlen, gfc_add_interface_mapping,
	gfc_finish_interface_mapping,
	gfc_apply_interface_mapping_to_expr): Likewise.
	* trans.h (gfc_interface_sym_mapping): Likewise.

diff -rup orig/egcc-SVN20080719/gcc/fortran/gfortran.h egcc-SVN20080719/gcc/fortran/gfortran.h
--- orig/egcc-SVN20080719/gcc/fortran/gfortran.h	2008-07-19 07:38:52.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/gfortran.h	2008-07-19 07:39:52.000000000 +0200
@@ -1053,8 +1053,6 @@ typedef struct gfc_symbol
      the old symbol.  */

   struct gfc_symbol *old_symbol, *tlink;
-  /* FIXME: This macro is temporary until we convert everything.  */
-#define new gfc_new
   unsigned mark:1, gfc_new:1;
   /* Nonzero if all equivalences associated with this symbol have been
      processed.  */
diff -rup orig/egcc-SVN20080719/gcc/fortran/array.c egcc-SVN20080719/gcc/fortran/array.c
--- orig/egcc-SVN20080719/gcc/fortran/array.c	2008-07-18 02:00:35.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/array.c	2008-07-19 07:41:42.000000000 +0200
@@ -592,7 +592,7 @@ gfc_start_constructor (bt type, int kind
    node onto the constructor.  */

 void
-gfc_append_constructor (gfc_expr *base, gfc_expr *new)
+gfc_append_constructor (gfc_expr *base, gfc_expr *new_expr)
 {
   gfc_constructor *c;

@@ -608,9 +608,9 @@ gfc_append_constructor (gfc_expr *base,
       c = c->next;
     }

-  c->expr = new;
+  c->expr = new_expr;

-  if (new->ts.type != base->ts.type || new->ts.kind != base->ts.kind)
+  if (new_expr->ts.type != base->ts.type || new_expr->ts.kind != base->ts.kind)
     gfc_internal_error ("gfc_append_constructor(): New node has wrong kind");
 }

@@ -755,7 +755,7 @@ static match match_array_cons_element (g
 static match
 match_array_list (gfc_constructor **result)
 {
-  gfc_constructor *p, *head, *tail, *new;
+  gfc_constructor *p, *head, *tail, *new_cons;
   gfc_iterator iter;
   locus old_loc;
   gfc_expr *e;
@@ -790,7 +790,7 @@ match_array_list (gfc_constructor **resu
       if (m == MATCH_ERROR)
 	goto cleanup;

-      m = match_array_cons_element (&new);
+      m = match_array_cons_element (&new_cons);
       if (m == MATCH_ERROR)
 	goto cleanup;
       if (m == MATCH_NO)
@@ -801,8 +801,8 @@ match_array_list (gfc_constructor **resu
 	  goto cleanup;		/* Could be a complex constant */
 	}

-      tail->next = new;
-      tail = new;
+      tail->next = new_cons;
+      tail = new_cons;

       if (gfc_match_char (',') != MATCH_YES)
 	{
@@ -881,7 +881,7 @@ match_array_cons_element (gfc_constructo
 match
 gfc_match_array_constructor (gfc_expr **result)
 {
-  gfc_constructor *head, *tail, *new;
+  gfc_constructor *head, *tail, *new_cons;
   gfc_expr *expr;
   gfc_typespec ts;
   locus where;
@@ -937,18 +937,18 @@ gfc_match_array_constructor (gfc_expr **

   for (;;)
     {
-      m = match_array_cons_element (&new);
+      m = match_array_cons_element (&new_cons);
       if (m == MATCH_ERROR)
 	goto cleanup;
       if (m == MATCH_NO)
 	goto syntax;

       if (head == NULL)
-	head = new;
+	head = new_cons;
       else
-	tail->next = new;
+	tail->next = new_cons;

-      tail = new;
+      tail = new_cons;

       if (gfc_match_char (',') == MATCH_NO)
 	break;
diff -rup orig/egcc-SVN20080719/gcc/fortran/bbt.c egcc-SVN20080719/gcc/fortran/bbt.c
--- orig/egcc-SVN20080719/gcc/fortran/bbt.c	2008-03-14 00:34:29.000000000 +0100
+++ egcc-SVN20080719/gcc/fortran/bbt.c	2008-07-19 07:43:01.000000000 +0200
@@ -93,24 +93,24 @@ rotate_right (gfc_bbt *t)
    aborts if we find a duplicate key.  */

 static gfc_bbt *
-insert (gfc_bbt *new, gfc_bbt *t, compare_fn compare)
+insert (gfc_bbt *new_bbt, gfc_bbt *t, compare_fn compare)
 {
   int c;

   if (t == NULL)
-    return new;
+    return new_bbt;

-  c = (*compare) (new, t);
+  c = (*compare) (new_bbt, t);

   if (c < 0)
     {
-      t->left = insert (new, t->left, compare);
+      t->left = insert (new_bbt, t->left, compare);
       if (t->priority < t->left->priority)
 	t = rotate_right (t);
     }
   else if (c > 0)
     {
-      t->right = insert (new, t->right, compare);
+      t->right = insert (new_bbt, t->right, compare);
       if (t->priority < t->right->priority)
 	t = rotate_left (t);
     }
@@ -126,12 +126,12 @@ insert (gfc_bbt *new, gfc_bbt *t, compar
    already exists.  */

 void
-gfc_insert_bbt (void *root, void *new, compare_fn compare)
+gfc_insert_bbt (void *root, void *new_node, compare_fn compare)
 {
   gfc_bbt **r, *n;

   r = (gfc_bbt **) root;
-  n = (gfc_bbt *) new;
+  n = (gfc_bbt *) new_node;
   n->priority = pseudo_random ();
   *r = insert (n, *r, compare);
 }
diff -rup orig/egcc-SVN20080719/gcc/fortran/decl.c egcc-SVN20080719/gcc/fortran/decl.c
--- orig/egcc-SVN20080719/gcc/fortran/decl.c	2008-07-19 07:38:52.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/decl.c	2008-07-19 07:44:47.000000000 +0200
@@ -231,21 +231,21 @@ syntax:
    variable-iterator list.  */

 static match
-var_element (gfc_data_variable *new)
+var_element (gfc_data_variable *new_var)
 {
   match m;
   gfc_symbol *sym;

-  memset (new, 0, sizeof (gfc_data_variable));
+  memset (new_var, 0, sizeof (gfc_data_variable));

   if (gfc_match_char ('(') == MATCH_YES)
-    return var_list (new);
+    return var_list (new_var);

-  m = gfc_match_variable (&new->expr, 0);
+  m = gfc_match_variable (&new_var->expr, 0);
   if (m != MATCH_YES)
     return m;

-  sym = new->expr->symtree->n.sym;
+  sym = new_var->expr->symtree->n.sym;

   if (!sym->attr.function && gfc_current_ns->parent
       && gfc_current_ns->parent == sym->ns)
@@ -262,7 +262,7 @@ var_element (gfc_data_variable *new)
 			 sym->name) == FAILURE)
     return MATCH_ERROR;

-  if (gfc_add_data (&sym->attr, sym->name, &new->expr->where) == FAILURE)
+  if (gfc_add_data (&sym->attr, sym->name, &new_var->expr->where) == FAILURE)
     return MATCH_ERROR;

   return MATCH_YES;
@@ -274,7 +274,7 @@ var_element (gfc_data_variable *new)
 static match
 top_var_list (gfc_data *d)
 {
-  gfc_data_variable var, *tail, *new;
+  gfc_data_variable var, *tail, *new_var;
   match m;

   tail = NULL;
@@ -287,15 +287,15 @@ top_var_list (gfc_data *d)
       if (m == MATCH_ERROR)
 	return MATCH_ERROR;

-      new = gfc_get_data_variable ();
-      *new = var;
+      new_var = gfc_get_data_variable ();
+      *new_var = var;

       if (tail == NULL)
-	d->var = new;
+	d->var = new_var;
       else
-	tail->next = new;
+	tail->next = new_var;

-      tail = new;
+      tail = new_var;

       if (gfc_match_char ('/') == MATCH_YES)
 	break;
@@ -404,7 +404,7 @@ match_data_constant (gfc_expr **result)
 static match
 top_val_list (gfc_data *data)
 {
-  gfc_data_value *new, *tail;
+  gfc_data_value *new_val, *tail;
   gfc_expr *expr;
   match m;

@@ -418,15 +418,15 @@ top_val_list (gfc_data *data)
       if (m == MATCH_ERROR)
 	return MATCH_ERROR;

-      new = gfc_get_data_value ();
-      mpz_init (new->repeat);
+      new_val = gfc_get_data_value ();
+      mpz_init (new_val->repeat);

       if (tail == NULL)
-	data->value = new;
+	data->value = new_val;
       else
-	tail->next = new;
+	tail->next = new_val;

-      tail = new;
+      tail = new_val;

       if (expr->ts.type != BT_INTEGER || gfc_match_char ('*') != MATCH_YES)
 	{
@@ -518,26 +518,26 @@ match_old_style_init (const char *name)
 match
 gfc_match_data (void)
 {
-  gfc_data *new;
+  gfc_data *new_data;
   match m;

   set_in_match_data (true);

   for (;;)
     {
-      new = gfc_get_data ();
-      new->where = gfc_current_locus;
+      new_data = gfc_get_data ();
+      new_data->where = gfc_current_locus;

-      m = top_var_list (new);
+      m = top_var_list (new_data);
       if (m != MATCH_YES)
 	goto cleanup;

-      m = top_val_list (new);
+      m = top_val_list (new_data);
       if (m != MATCH_YES)
 	goto cleanup;

-      new->next = gfc_current_ns->data;
-      gfc_current_ns->data = new;
+      new_data->next = gfc_current_ns->data;
+      gfc_current_ns->data = new_data;

       if (gfc_match_eos () == MATCH_YES)
 	break;
@@ -557,7 +557,7 @@ gfc_match_data (void)

 cleanup:
   set_in_match_data (false);
-  gfc_free_data (new);
+  gfc_free_data (new_data);
   return MATCH_ERROR;
 }

@@ -781,7 +781,7 @@ get_proc_name (const char *name, gfc_sym
   sym = *result;
   gfc_current_ns->refs++;

-  if (sym && !sym->new && gfc_current_state () != COMP_INTERFACE)
+  if (sym && !sym->gfc_new && gfc_current_state () != COMP_INTERFACE)
     {
       /* Trap another encompassed procedure with the same name.  All
 	 these conditions are necessary to avoid picking up an entry
diff -rup orig/egcc-SVN20080719/gcc/fortran/expr.c egcc-SVN20080719/gcc/fortran/expr.c
--- orig/egcc-SVN20080719/gcc/fortran/expr.c	2008-07-19 07:38:52.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/expr.c	2008-07-19 07:45:37.000000000 +0200
@@ -65,24 +65,24 @@ gfc_free_actual_arglist (gfc_actual_argl
 gfc_actual_arglist *
 gfc_copy_actual_arglist (gfc_actual_arglist *p)
 {
-  gfc_actual_arglist *head, *tail, *new;
+  gfc_actual_arglist *head, *tail, *new_arg;

   head = tail = NULL;

   for (; p; p = p->next)
     {
-      new = gfc_get_actual_arglist ();
-      *new = *p;
+      new_arg = gfc_get_actual_arglist ();
+      *new_arg = *p;

-      new->expr = gfc_copy_expr (p->expr);
-      new->next = NULL;
+      new_arg->expr = gfc_copy_expr (p->expr);
+      new_arg->next = NULL;

       if (head == NULL)
-	head = new;
+	head = new_arg;
       else
-	tail->next = new;
+	tail->next = new_arg;

-      tail = new;
+      tail = new_arg;
     }

   return head;
diff -rup orig/egcc-SVN20080719/gcc/fortran/interface.c egcc-SVN20080719/gcc/fortran/interface.c
--- orig/egcc-SVN20080719/gcc/fortran/interface.c	2008-07-19 07:38:52.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/interface.c	2008-07-19 07:46:55.000000000 +0200
@@ -1823,7 +1823,7 @@ static int
 compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
 		       int ranks_must_agree, int is_elemental, locus *where)
 {
-  gfc_actual_arglist **new, *a, *actual, temp;
+  gfc_actual_arglist **new_arg, *a, *actual, temp;
   gfc_formal_arglist *f;
   int i, n, na;
   unsigned long actual_size, formal_size;
@@ -1837,10 +1837,10 @@ compare_actual_formal (gfc_actual_arglis
   for (f = formal; f; f = f->next)
     n++;

-  new = (gfc_actual_arglist **) alloca (n * sizeof (gfc_actual_arglist *));
+  new_arg = (gfc_actual_arglist **) alloca (n * sizeof (gfc_actual_arglist *));

   for (i = 0; i < n; i++)
-    new[i] = NULL;
+    new_arg[i] = NULL;

   na = 0;
   f = formal;
@@ -1868,7 +1868,7 @@ compare_actual_formal (gfc_actual_arglis
 	      return 0;
 	    }

-	  if (new[i] != NULL)
+	  if (new_arg[i] != NULL)
 	    {
 	      if (where)
 		gfc_error ("Keyword argument '%s' at %L is already associated "
@@ -2113,14 +2113,14 @@ compare_actual_formal (gfc_actual_arglis
       if (a == actual)
 	na = i;

-      new[i++] = a;
+      new_arg[i++] = a;
     }

   /* Make sure missing actual arguments are optional.  */
   i = 0;
   for (f = formal; f; f = f->next, i++)
     {
-      if (new[i] != NULL)
+      if (new_arg[i] != NULL)
 	continue;
       if (f->sym == NULL)
 	{
@@ -2142,27 +2142,27 @@ compare_actual_formal (gfc_actual_arglis
      argument list with null arguments in the right places.  The head
      of the list remains the head.  */
   for (i = 0; i < n; i++)
-    if (new[i] == NULL)
-      new[i] = gfc_get_actual_arglist ();
+    if (new_arg[i] == NULL)
+      new_arg[i] = gfc_get_actual_arglist ();

   if (na != 0)
     {
-      temp = *new[0];
-      *new[0] = *actual;
+      temp = *new_arg[0];
+      *new_arg[0] = *actual;
       *actual = temp;

-      a = new[0];
-      new[0] = new[na];
-      new[na] = a;
+      a = new_arg[0];
+      new_arg[0] = new_arg[na];
+      new_arg[na] = a;
     }

   for (i = 0; i < n - 1; i++)
-    new[i]->next = new[i + 1];
+    new_arg[i]->next = new_arg[i + 1];

-  new[i]->next = NULL;
+  new_arg[i]->next = NULL;

   if (*ap == NULL && n > 0)
-    *ap = new[0];
+    *ap = new_arg[0];

   /* Note the types of omitted optional arguments.  */
   for (a = *ap, f = formal; a; a = a->next, f = f->next)
@@ -2732,16 +2732,16 @@ gfc_extend_assign (gfc_code *c, gfc_name
    procedures can be present without interfaces.  */

 static try
-check_new_interface (gfc_interface *base, gfc_symbol *new)
+check_new_interface (gfc_interface *base, gfc_symbol *new_sym)
 {
   gfc_interface *ip;

   for (ip = base; ip; ip = ip->next)
     {
-      if (ip->sym == new)
+      if (ip->sym == new_sym)
 	{
 	  gfc_error ("Entity '%s' at %C is already present in the interface",
-		     new->name);
+		     new_sym->name);
 	  return FAILURE;
 	}
     }
@@ -2753,7 +2753,7 @@ check_new_interface (gfc_interface *base
 /* Add a symbol to the current interface.  */

 try
-gfc_add_interface (gfc_symbol *new)
+gfc_add_interface (gfc_symbol *new_sym)
 {
   gfc_interface **head, *intr;
   gfc_namespace *ns;
@@ -2771,48 +2771,48 @@ gfc_add_interface (gfc_symbol *new)
 	  {
 	    case INTRINSIC_EQ:
 	    case INTRINSIC_EQ_OS:
-	      if (check_new_interface (ns->op[INTRINSIC_EQ], new) == FAILURE ||
-	          check_new_interface (ns->op[INTRINSIC_EQ_OS], new) == FAILURE)
+	      if (check_new_interface (ns->op[INTRINSIC_EQ], new_sym) == FAILURE ||
+	          check_new_interface (ns->op[INTRINSIC_EQ_OS], new_sym) == FAILURE)
 		return FAILURE;
 	      break;

 	    case INTRINSIC_NE:
 	    case INTRINSIC_NE_OS:
-	      if (check_new_interface (ns->op[INTRINSIC_NE], new) == FAILURE ||
-	          check_new_interface (ns->op[INTRINSIC_NE_OS], new) == FAILURE)
+	      if (check_new_interface (ns->op[INTRINSIC_NE], new_sym) == FAILURE ||
+	          check_new_interface (ns->op[INTRINSIC_NE_OS], new_sym) == FAILURE)
 		return FAILURE;
 	      break;

 	    case INTRINSIC_GT:
 	    case INTRINSIC_GT_OS:
-	      if (check_new_interface (ns->op[INTRINSIC_GT], new) == FAILURE ||
-	          check_new_interface (ns->op[INTRINSIC_GT_OS], new) == FAILURE)
+	      if (check_new_interface (ns->op[INTRINSIC_GT], new_sym) == FAILURE ||
+	          check_new_interface (ns->op[INTRINSIC_GT_OS], new_sym) == FAILURE)
 		return FAILURE;
 	      break;

 	    case INTRINSIC_GE:
 	    case INTRINSIC_GE_OS:
-	      if (check_new_interface (ns->op[INTRINSIC_GE], new) == FAILURE ||
-	          check_new_interface (ns->op[INTRINSIC_GE_OS], new) == FAILURE)
+	      if (check_new_interface (ns->op[INTRINSIC_GE], new_sym) == FAILURE ||
+	          check_new_interface (ns->op[INTRINSIC_GE_OS], new_sym) == FAILURE)
 		return FAILURE;
 	      break;

 	    case INTRINSIC_LT:
 	    case INTRINSIC_LT_OS:
-	      if (check_new_interface (ns->op[INTRINSIC_LT], new) == FAILURE ||
-	          check_new_interface (ns->op[INTRINSIC_LT_OS], new) == FAILURE)
+	      if (check_new_interface (ns->op[INTRINSIC_LT], new_sym) == FAILURE ||
+	          check_new_interface (ns->op[INTRINSIC_LT_OS], new_sym) == FAILURE)
 		return FAILURE;
 	      break;

 	    case INTRINSIC_LE:
 	    case INTRINSIC_LE_OS:
-	      if (check_new_interface (ns->op[INTRINSIC_LE], new) == FAILURE ||
-	          check_new_interface (ns->op[INTRINSIC_LE_OS], new) == FAILURE)
+	      if (check_new_interface (ns->op[INTRINSIC_LE], new_sym) == FAILURE ||
+	          check_new_interface (ns->op[INTRINSIC_LE_OS], new_sym) == FAILURE)
 		return FAILURE;
 	      break;

 	    default:
-	      if (check_new_interface (ns->op[current_interface.op], new) == FAILURE)
+	      if (check_new_interface (ns->op[current_interface.op], new_sym) == FAILURE)
 		return FAILURE;
 	  }

@@ -2826,7 +2826,7 @@ gfc_add_interface (gfc_symbol *new)
 	  if (sym == NULL)
 	    continue;

-	  if (check_new_interface (sym->generic, new) == FAILURE)
+	  if (check_new_interface (sym->generic, new_sym) == FAILURE)
 	    return FAILURE;
 	}

@@ -2834,7 +2834,7 @@ gfc_add_interface (gfc_symbol *new)
       break;

     case INTERFACE_USER_OP:
-      if (check_new_interface (current_interface.uop->op, new)
+      if (check_new_interface (current_interface.uop->op, new_sym)
 	  == FAILURE)
 	return FAILURE;

@@ -2846,7 +2846,7 @@ gfc_add_interface (gfc_symbol *new)
     }

   intr = gfc_get_interface ();
-  intr->sym = new;
+  intr->sym = new_sym;
   intr->where = gfc_current_locus;

   intr->next = *head;
diff -rup orig/egcc-SVN20080719/gcc/fortran/intrinsic.c egcc-SVN20080719/gcc/fortran/intrinsic.c
--- orig/egcc-SVN20080719/gcc/fortran/intrinsic.c	2008-06-20 08:19:02.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/intrinsic.c	2008-07-19 07:47:55.000000000 +0200
@@ -3680,7 +3680,7 @@ gfc_convert_type_warn (gfc_expr *expr, g
   gfc_intrinsic_sym *sym;
   gfc_typespec from_ts;
   locus old_where;
-  gfc_expr *new;
+  gfc_expr *new_expr;
   int rank;
   mpz_t *shape;

@@ -3722,29 +3722,29 @@ gfc_convert_type_warn (gfc_expr *expr, g
   rank = expr->rank;
   shape = expr->shape;

-  new = gfc_get_expr ();
-  *new = *expr;
+  new_expr = gfc_get_expr ();
+  *new_expr = *expr;

-  new = gfc_build_conversion (new);
-  new->value.function.name = sym->lib_name;
-  new->value.function.isym = sym;
-  new->where = old_where;
-  new->rank = rank;
-  new->shape = gfc_copy_shape (shape, rank);
-
-  gfc_get_ha_sym_tree (sym->name, &new->symtree);
-  new->symtree->n.sym->ts = *ts;
-  new->symtree->n.sym->attr.flavor = FL_PROCEDURE;
-  new->symtree->n.sym->attr.function = 1;
-  new->symtree->n.sym->attr.elemental = 1;
-  new->symtree->n.sym->attr.pure = 1;
-  new->symtree->n.sym->attr.referenced = 1;
-  gfc_intrinsic_symbol(new->symtree->n.sym);
-  gfc_commit_symbol (new->symtree->n.sym);
+  new_expr = gfc_build_conversion (new_expr);
+  new_expr->value.function.name = sym->lib_name;
+  new_expr->value.function.isym = sym;
+  new_expr->where = old_where;
+  new_expr->rank = rank;
+  new_expr->shape = gfc_copy_shape (shape, rank);
+
+  gfc_get_ha_sym_tree (sym->name, &new_expr->symtree);
+  new_expr->symtree->n.sym->ts = *ts;
+  new_expr->symtree->n.sym->attr.flavor = FL_PROCEDURE;
+  new_expr->symtree->n.sym->attr.function = 1;
+  new_expr->symtree->n.sym->attr.elemental = 1;
+  new_expr->symtree->n.sym->attr.pure = 1;
+  new_expr->symtree->n.sym->attr.referenced = 1;
+  gfc_intrinsic_symbol(new_expr->symtree->n.sym);
+  gfc_commit_symbol (new_expr->symtree->n.sym);

-  *expr = *new;
+  *expr = *new_expr;

-  gfc_free (new);
+  gfc_free (new_expr);
   expr->ts = *ts;

   if (gfc_is_constant_expr (expr->value.function.actual->expr)
@@ -3779,7 +3779,7 @@ gfc_convert_chartype (gfc_expr *expr, gf
   gfc_intrinsic_sym *sym;
   gfc_typespec from_ts;
   locus old_where;
-  gfc_expr *new;
+  gfc_expr *new_expr;
   int rank;
   mpz_t *shape;

@@ -3794,28 +3794,28 @@ gfc_convert_chartype (gfc_expr *expr, gf
   rank = expr->rank;
   shape = expr->shape;

-  new = gfc_get_expr ();
-  *new = *expr;
+  new_expr = gfc_get_expr ();
+  *new_expr = *expr;

-  new = gfc_build_conversion (new);
-  new->value.function.name = sym->lib_name;
-  new->value.function.isym = sym;
-  new->where = old_where;
-  new->rank = rank;
-  new->shape = gfc_copy_shape (shape, rank);
-
-  gfc_get_ha_sym_tree (sym->name, &new->symtree);
-  new->symtree->n.sym->ts = *ts;
-  new->symtree->n.sym->attr.flavor = FL_PROCEDURE;
-  new->symtree->n.sym->attr.function = 1;
-  new->symtree->n.sym->attr.elemental = 1;
-  new->symtree->n.sym->attr.referenced = 1;
-  gfc_intrinsic_symbol(new->symtree->n.sym);
-  gfc_commit_symbol (new->symtree->n.sym);
+  new_expr = gfc_build_conversion (new_expr);
+  new_expr->value.function.name = sym->lib_name;
+  new_expr->value.function.isym = sym;
+  new_expr->where = old_where;
+  new_expr->rank = rank;
+  new_expr->shape = gfc_copy_shape (shape, rank);
+
+  gfc_get_ha_sym_tree (sym->name, &new_expr->symtree);
+  new_expr->symtree->n.sym->ts = *ts;
+  new_expr->symtree->n.sym->attr.flavor = FL_PROCEDURE;
+  new_expr->symtree->n.sym->attr.function = 1;
+  new_expr->symtree->n.sym->attr.elemental = 1;
+  new_expr->symtree->n.sym->attr.referenced = 1;
+  gfc_intrinsic_symbol(new_expr->symtree->n.sym);
+  gfc_commit_symbol (new_expr->symtree->n.sym);

-  *expr = *new;
+  *expr = *new_expr;

-  gfc_free (new);
+  gfc_free (new_expr);
   expr->ts = *ts;

   if (gfc_is_constant_expr (expr->value.function.actual->expr)
diff -rup orig/egcc-SVN20080719/gcc/fortran/io.c egcc-SVN20080719/gcc/fortran/io.c
--- orig/egcc-SVN20080719/gcc/fortran/io.c	2008-07-15 02:00:40.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/io.c	2008-07-19 07:48:32.000000000 +0200
@@ -2623,7 +2623,7 @@ static match match_io_element (io_kind,
 static match
 match_io_iterator (io_kind k, gfc_code **result)
 {
-  gfc_code *head, *tail, *new;
+  gfc_code *head, *tail, *new_code;
   gfc_iterator *iter;
   locus old_loc;
   match m;
@@ -2659,7 +2659,7 @@ match_io_iterator (io_kind k, gfc_code *
 	  break;
 	}

-      m = match_io_element (k, &new);
+      m = match_io_element (k, &new_code);
       if (m == MATCH_ERROR)
 	goto cleanup;
       if (m == MATCH_NO)
@@ -2669,7 +2669,7 @@ match_io_iterator (io_kind k, gfc_code *
 	  goto cleanup;
 	}

-      tail = gfc_append_code (tail, new);
+      tail = gfc_append_code (tail, new_code);

       if (gfc_match_char (',') != MATCH_YES)
 	{
@@ -2683,15 +2683,15 @@ match_io_iterator (io_kind k, gfc_code *
   if (gfc_match_char (')') != MATCH_YES)
     goto syntax;

-  new = gfc_get_code ();
-  new->op = EXEC_DO;
-  new->ext.iterator = iter;
-
-  new->block = gfc_get_code ();
-  new->block->op = EXEC_DO;
-  new->block->next = head;
+  new_code = gfc_get_code ();
+  new_code->op = EXEC_DO;
+  new_code->ext.iterator = iter;
+
+  new_code->block = gfc_get_code ();
+  new_code->block->op = EXEC_DO;
+  new_code->block->next = head;

-  *result = new;
+  *result = new_code;
   return MATCH_YES;

 syntax:
@@ -2799,7 +2799,7 @@ match_io_element (io_kind k, gfc_code **
 static match
 match_io_list (io_kind k, gfc_code **head_p)
 {
-  gfc_code *head, *tail, *new;
+  gfc_code *head, *tail, *new_code;
   match m;

   *head_p = head = tail = NULL;
@@ -2808,15 +2808,15 @@ match_io_list (io_kind k, gfc_code **hea

   for (;;)
     {
-      m = match_io_element (k, &new);
+      m = match_io_element (k, &new_code);
       if (m == MATCH_ERROR)
 	goto cleanup;
       if (m == MATCH_NO)
 	goto syntax;

-      tail = gfc_append_code (tail, new);
+      tail = gfc_append_code (tail, new_code);
       if (head == NULL)
-	head = new;
+	head = new_code;

       if (gfc_match_eos () == MATCH_YES)
 	break;
diff -rup orig/egcc-SVN20080719/gcc/fortran/match.c egcc-SVN20080719/gcc/fortran/match.c
--- orig/egcc-SVN20080719/gcc/fortran/match.c	2008-07-19 07:23:21.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/match.c	2008-07-19 07:49:10.000000000 +0200
@@ -3836,7 +3836,7 @@ cleanup:
 static match
 match_forall_header (gfc_forall_iterator **phead, gfc_expr **mask)
 {
-  gfc_forall_iterator *head, *tail, *new;
+  gfc_forall_iterator *head, *tail, *new_iter;
   gfc_expr *msk;
   match m;

@@ -3848,27 +3848,27 @@ match_forall_header (gfc_forall_iterator
   if (gfc_match_char ('(') != MATCH_YES)
     return MATCH_NO;

-  m = match_forall_iterator (&new);
+  m = match_forall_iterator (&new_iter);
   if (m == MATCH_ERROR)
     goto cleanup;
   if (m == MATCH_NO)
     goto syntax;

-  head = tail = new;
+  head = tail = new_iter;

   for (;;)
     {
       if (gfc_match_char (',') != MATCH_YES)
 	break;

-      m = match_forall_iterator (&new);
+      m = match_forall_iterator (&new_iter);
       if (m == MATCH_ERROR)
 	goto cleanup;

       if (m == MATCH_YES)
 	{
-	  tail->next = new;
-	  tail = new;
+	  tail->next = new_iter;
+	  tail = new_iter;
 	  continue;
 	}

diff -rup orig/egcc-SVN20080719/gcc/fortran/matchexp.c egcc-SVN20080719/gcc/fortran/matchexp.c
--- orig/egcc-SVN20080719/gcc/fortran/matchexp.c	2008-07-19 07:38:52.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/matchexp.c	2008-07-19 07:49:44.000000000 +0200
@@ -211,17 +211,17 @@ static gfc_expr *
 build_node (gfc_intrinsic_op op, locus *where,
 	    gfc_expr *op1, gfc_expr *op2)
 {
-  gfc_expr *new;
+  gfc_expr *new_expr;

-  new = gfc_get_expr ();
-  new->expr_type = EXPR_OP;
-  new->value.op.op = op;
-  new->where = *where;
+  new_expr = gfc_get_expr ();
+  new_expr->expr_type = EXPR_OP;
+  new_expr->value.op.op = op;
+  new_expr->where = *where;

-  new->value.op.op1 = op1;
-  new->value.op.op2 = op2;
+  new_expr->value.op.op1 = op1;
+  new_expr->value.op.op2 = op2;

-  return new;
+  return new_expr;
 }


diff -rup orig/egcc-SVN20080719/gcc/fortran/module.c egcc-SVN20080719/gcc/fortran/module.c
--- orig/egcc-SVN20080719/gcc/fortran/module.c	2008-07-19 07:38:52.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/module.c	2008-07-19 07:50:30.000000000 +0200
@@ -502,7 +502,7 @@ match
 gfc_match_use (void)
 {
   char name[GFC_MAX_SYMBOL_LEN + 1], module_nature[GFC_MAX_SYMBOL_LEN + 1];
-  gfc_use_rename *tail = NULL, *new;
+  gfc_use_rename *tail = NULL, *new_use;
   interface_type type, type2;
   gfc_intrinsic_op op;
   match m;
@@ -581,19 +581,19 @@ gfc_match_use (void)
   for (;;)
     {
       /* Get a new rename struct and add it to the rename list.  */
-      new = gfc_get_use_rename ();
-      new->where = gfc_current_locus;
-      new->found = 0;
+      new_use = gfc_get_use_rename ();
+      new_use->where = gfc_current_locus;
+      new_use->found = 0;

       if (gfc_rename_list == NULL)
-	gfc_rename_list = new;
+	gfc_rename_list = new_use;
       else
-	tail->next = new;
-      tail = new;
+	tail->next = new_use;
+      tail = new_use;

       /* See what kind of interface we're dealing with.  Assume it is
 	 not an operator.  */
-      new->op = INTRINSIC_NONE;
+      new_use->op = INTRINSIC_NONE;
       if (gfc_match_generic_spec (&type, name, &op) == MATCH_ERROR)
 	goto cleanup;

@@ -614,16 +614,16 @@ gfc_match_use (void)
 	    goto cleanup;

 	  if (type == INTERFACE_USER_OP)
-	    new->op = INTRINSIC_USER;
+	    new_use->op = INTRINSIC_USER;

 	  if (only_flag)
 	    {
 	      if (m != MATCH_YES)
-		strcpy (new->use_name, name);
+		strcpy (new_use->use_name, name);
 	      else
 		{
-		  strcpy (new->local_name, name);
-		  m = gfc_match_generic_spec (&type2, new->use_name, &op);
+		  strcpy (new_use->local_name, name);
+		  m = gfc_match_generic_spec (&type2, new_use->use_name, &op);
 		  if (type != type2)
 		    goto syntax;
 		  if (m == MATCH_NO)
@@ -636,9 +636,9 @@ gfc_match_use (void)
 	    {
 	      if (m != MATCH_YES)
 		goto syntax;
-	      strcpy (new->local_name, name);
+	      strcpy (new_use->local_name, name);

-	      m = gfc_match_generic_spec (&type2, new->use_name, &op);
+	      m = gfc_match_generic_spec (&type2, new_use->use_name, &op);
 	      if (type != type2)
 		goto syntax;
 	      if (m == MATCH_NO)
@@ -647,8 +647,8 @@ gfc_match_use (void)
 		goto cleanup;
 	    }

-	  if (strcmp (new->use_name, module_name) == 0
-	      || strcmp (new->local_name, module_name) == 0)
+	  if (strcmp (new_use->use_name, module_name) == 0
+	      || strcmp (new_use->local_name, module_name) == 0)
 	    {
 	      gfc_error ("The name '%s' at %C has already been used as "
 			 "an external module name.", module_name);
@@ -657,7 +657,7 @@ gfc_match_use (void)
 	  break;

 	case INTERFACE_INTRINSIC_OP:
-	  new->op = op;
+	  new_use->op = op;
 	  break;

 	default:
diff -rup orig/egcc-SVN20080719/gcc/fortran/scanner.c egcc-SVN20080719/gcc/fortran/scanner.c
--- orig/egcc-SVN20080719/gcc/fortran/scanner.c	2008-06-21 02:00:03.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/scanner.c	2008-07-19 07:51:00.000000000 +0200
@@ -1840,11 +1840,11 @@ load_file (const char *filename, bool in
 				&& line[2] == (unsigned char) '\xBF')))
 	{
 	  int n = line[1] == (unsigned char) '\xBB' ? 3 : 2;
-	  gfc_char_t *new = gfc_get_wide_string (line_len);
+	  gfc_char_t *new_char = gfc_get_wide_string (line_len);

-	  wide_strcpy (new, &line[n]);
+	  wide_strcpy (new_char, &line[n]);
 	  gfc_free (line);
-	  line = new;
+	  line = new_char;
 	  len -= n;
 	}

diff -rup orig/egcc-SVN20080719/gcc/fortran/st.c egcc-SVN20080719/gcc/fortran/st.c
--- orig/egcc-SVN20080719/gcc/fortran/st.c	2008-06-20 08:19:02.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/st.c	2008-07-19 07:51:12.000000000 +0200
@@ -58,20 +58,20 @@ gfc_get_code (void)
    its tail, returning a pointer to the new tail.  */

 gfc_code *
-gfc_append_code (gfc_code *tail, gfc_code *new)
+gfc_append_code (gfc_code *tail, gfc_code *new_code)
 {
   if (tail != NULL)
     {
       while (tail->next != NULL)
 	tail = tail->next;

-      tail->next = new;
+      tail->next = new_code;
     }

-  while (new->next != NULL)
-    new = new->next;
+  while (new_code->next != NULL)
+    new_code = new_code->next;

-  return new;
+  return new_code;
 }


diff -rup orig/egcc-SVN20080719/gcc/fortran/symbol.c egcc-SVN20080719/gcc/fortran/symbol.c
--- orig/egcc-SVN20080719/gcc/fortran/symbol.c	2008-07-19 07:38:52.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/symbol.c	2008-07-19 07:52:09.000000000 +0200
@@ -2451,7 +2451,7 @@ static void
 save_symbol_data (gfc_symbol *sym)
 {

-  if (sym->new || sym->old_symbol != NULL)
+  if (sym->gfc_new || sym->old_symbol != NULL)
     return;

   sym->old_symbol = XCNEW (gfc_symbol);
@@ -2495,7 +2495,7 @@ gfc_get_sym_tree (const char *name, gfc_
       p->old_symbol = NULL;
       p->tlink = changed_syms;
       p->mark = 1;
-      p->new = 1;
+      p->gfc_new = 1;
       changed_syms = p;

       st = gfc_new_symtree (&ns->sym_root, name);
@@ -2643,7 +2643,7 @@ gfc_undo_symbols (void)
     {
       q = p->tlink;

-      if (p->new)
+      if (p->gfc_new)
 	{
 	  /* Symbol was new.  */
 	  if (p->attr.in_common && p->common_block->head)
@@ -2779,7 +2779,7 @@ gfc_commit_symbols (void)
       q = p->tlink;
       p->tlink = NULL;
       p->mark = 0;
-      p->new = 0;
+      p->gfc_new = 0;
       free_old_symbol (p);
     }
   changed_syms = NULL;
@@ -2808,7 +2808,7 @@ gfc_commit_symbol (gfc_symbol *sym)

   sym->tlink = NULL;
   sym->mark = 0;
-  sym->new = 0;
+  sym->gfc_new = 0;

   free_old_symbol (sym);
 }
diff -rup orig/egcc-SVN20080719/gcc/fortran/trans-common.c egcc-SVN20080719/gcc/fortran/trans-common.c
--- orig/egcc-SVN20080719/gcc/fortran/trans-common.c	2008-04-27 02:02:08.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/trans-common.c	2008-07-19 07:54:16.000000000 +0200
@@ -321,10 +321,10 @@ build_field (segment_info *h, tree union
   /* If this field is volatile, mark it.  */
   if (h->sym->attr.volatile_)
     {
-      tree new;
+      tree new_type;
       TREE_THIS_VOLATILE (field) = 1;
-      new = build_qualified_type (TREE_TYPE (field), TYPE_QUAL_VOLATILE);
-      TREE_TYPE (field) = new;
+      new_type = build_qualified_type (TREE_TYPE (field), TYPE_QUAL_VOLATILE);
+      TREE_TYPE (field) = new_type;
     }

   h->field = field;
diff -rup orig/egcc-SVN20080719/gcc/fortran/trans-decl.c egcc-SVN20080719/gcc/fortran/trans-decl.c
--- orig/egcc-SVN20080719/gcc/fortran/trans-decl.c	2008-07-03 02:00:14.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/trans-decl.c	2008-07-19 07:54:58.000000000 +0200
@@ -461,7 +461,7 @@ gfc_finish_decl (tree decl)
 static void
 gfc_finish_var_decl (tree decl, gfc_symbol * sym)
 {
-  tree new;
+  tree new_type;
   /* TREE_ADDRESSABLE means the address of this variable is actually needed.
      This is the equivalent of the TARGET variables.
      We also need to set this if the variable is passed by reference in a
@@ -535,8 +535,8 @@ gfc_finish_var_decl (tree decl, gfc_symb
   if (sym->attr.volatile_)
     {
       TREE_THIS_VOLATILE (decl) = 1;
-      new = build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_VOLATILE);
-      TREE_TYPE (decl) = new;
+      new_type = build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_VOLATILE);
+      TREE_TYPE (decl) = new_type;
     }

   /* Keep variables larger than max-stack-var-size off stack.  */
diff -rup orig/egcc-SVN20080719/gcc/fortran/trans-expr.c egcc-SVN20080719/gcc/fortran/trans-expr.c
--- orig/egcc-SVN20080719/gcc/fortran/trans-expr.c	2008-07-19 07:38:52.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/trans-expr.c	2008-07-19 07:57:04.000000000 +0200
@@ -1460,9 +1460,9 @@ gfc_free_interface_mapping (gfc_interfac
   for (sym = mapping->syms; sym; sym = nextsym)
     {
       nextsym = sym->next;
-      gfc_free_symbol (sym->new->n.sym);
+      gfc_free_symbol (sym->new_sym->n.sym);
       gfc_free_expr (sym->expr);
-      gfc_free (sym->new);
+      gfc_free (sym->new_sym);
       gfc_free (sym);
     }
   for (cl = mapping->charlens; cl; cl = nextcl)
@@ -1481,14 +1481,14 @@ static gfc_charlen *
 gfc_get_interface_mapping_charlen (gfc_interface_mapping * mapping,
 				   gfc_charlen * cl)
 {
-  gfc_charlen *new;
+  gfc_charlen *new_charlen;

-  new = gfc_get_charlen ();
-  new->next = mapping->charlens;
-  new->length = gfc_copy_expr (cl->length);
+  new_charlen = gfc_get_charlen ();
+  new_charlen->next = mapping->charlens;
+  new_charlen->length = gfc_copy_expr (cl->length);

-  mapping->charlens = new;
-  return new;
+  mapping->charlens = new_charlen;
+  return new_charlen;
 }


@@ -1597,7 +1597,7 @@ gfc_add_interface_mapping (gfc_interface
   sm = XCNEW (gfc_interface_sym_mapping);
   sm->next = mapping->syms;
   sm->old = sym;
-  sm->new = new_symtree;
+  sm->new_sym = new_symtree;
   sm->expr = gfc_copy_expr (expr);
   mapping->syms = sm;

@@ -1689,10 +1689,10 @@ gfc_finish_interface_mapping (gfc_interf
   gfc_se se;

   for (sym = mapping->syms; sym; sym = sym->next)
-    if (sym->new->n.sym->ts.type == BT_CHARACTER
-	&& !sym->new->n.sym->ts.cl->backend_decl)
+    if (sym->new_sym->n.sym->ts.type == BT_CHARACTER
+	&& !sym->new_sym->n.sym->ts.cl->backend_decl)
       {
-	expr = sym->new->n.sym->ts.cl->length;
+	expr = sym->new_sym->n.sym->ts.cl->length;
 	gfc_apply_interface_mapping_to_expr (mapping, expr);
 	gfc_init_se (&se, NULL);
 	gfc_conv_expr (&se, expr);
@@ -1701,7 +1701,7 @@ gfc_finish_interface_mapping (gfc_interf
 	gfc_add_block_to_block (pre, &se.pre);
 	gfc_add_block_to_block (post, &se.post);

-	sym->new->n.sym->ts.cl->backend_decl = se.expr;
+	sym->new_sym->n.sym->ts.cl->backend_decl = se.expr;
       }
 }

@@ -1931,8 +1931,8 @@ gfc_apply_interface_mapping_to_expr (gfc
   for (sym = mapping->syms; sym; sym = sym->next)
     if (expr->symtree && sym->old == expr->symtree->n.sym)
       {
-	if (sym->new->n.sym->backend_decl)
-	  expr->symtree = sym->new;
+	if (sym->new_sym->n.sym->backend_decl)
+	  expr->symtree = sym->new_sym;
 	else if (sym->expr)
 	  gfc_replace_expr (expr, gfc_copy_expr (sym->expr));
       }
@@ -1964,9 +1964,9 @@ gfc_apply_interface_mapping_to_expr (gfc
       for (sym = mapping->syms; sym; sym = sym->next)
 	if (sym->old == expr->value.function.esym)
 	  {
-	    expr->value.function.esym = sym->new->n.sym;
+	    expr->value.function.esym = sym->new_sym->n.sym;
 	    gfc_map_fcn_formal_to_actual (expr, sym->expr, mapping);
-	    expr->value.function.esym->result = sym->new->n.sym;
+	    expr->value.function.esym->result = sym->new_sym->n.sym;
 	  }
       break;

diff -rup orig/egcc-SVN20080719/gcc/fortran/trans.h egcc-SVN20080719/gcc/fortran/trans.h
--- orig/egcc-SVN20080719/gcc/fortran/trans.h	2008-06-20 08:19:02.000000000 +0200
+++ egcc-SVN20080719/gcc/fortran/trans.h	2008-07-19 07:53:10.000000000 +0200
@@ -710,7 +710,7 @@ typedef struct gfc_interface_sym_mapping
 {
   struct gfc_interface_sym_mapping *next;
   gfc_symbol *old;
-  gfc_symtree *new;
+  gfc_symtree *new_sym;
   gfc_expr *expr;
 }
 gfc_interface_sym_mapping;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]