OSDN Git Service

2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Oct 2010 15:29:46 +0000 (15:29 +0000)
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Oct 2010 15:29:46 +0000 (15:29 +0000)
* array.c (gfc_match_array_spec): Don't re-initialize cleared struct.
* symbol.c (gen_shape_param): Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165039 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/array.c
gcc/fortran/symbol.c

index 80b013f..63a818c 100644 (file)
@@ -1,5 +1,10 @@
 2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>
 
+       * array.c (gfc_match_array_spec): Don't re-initialize cleared struct.
+       * symbol.c (gen_shape_param): Ditto.
+
+2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>
+
        * symbol.c (free_entry_list): New function.
        (gfc_free_namespace): Free list of entries.
 
index a26be78..8c74e70 100644 (file)
@@ -437,16 +437,8 @@ gfc_match_array_spec (gfc_array_spec **asp, bool match_dim, bool match_codim)
   array_type current_type;
   gfc_array_spec *as;
   int i;
-  as = gfc_get_array_spec ();
-  as->corank = 0;
-  as->rank = 0;
 
-  for (i = 0; i < GFC_MAX_DIMENSIONS; i++)
-    {
-      as->lower[i] = NULL;
-      as->upper[i] = NULL;
-    }
+  as = gfc_get_array_spec ();
 
   if (!match_dim)
     goto coarray;
index b900bc1..93199cf 100644 (file)
@@ -3968,7 +3968,6 @@ gen_shape_param (gfc_formal_arglist **head,
   gfc_symtree *param_symtree = NULL;
   gfc_formal_arglist *formal_arg = NULL;
   const char *shape_param = "gfc_shape_array__";
-  int i;
 
   if (shape_param_name != NULL)
     shape_param = shape_param_name;
@@ -3994,15 +3993,9 @@ gen_shape_param (gfc_formal_arglist **head,
   /* Initialize the kind to default integer.  However, it will be overridden
      during resolution to match the kind of the SHAPE parameter given as
      the actual argument (to allow for any valid integer kind).  */
-  param_sym->ts.kind = gfc_default_integer_kind;   
+  param_sym->ts.kind = gfc_default_integer_kind;
   param_sym->as = gfc_get_array_spec ();
 
-  /* Clear out the dimension info for the array.  */
-  for (i = 0; i < GFC_MAX_DIMENSIONS; i++)
-    {
-      param_sym->as->lower[i] = NULL;
-      param_sym->as->upper[i] = NULL;
-    }
   param_sym->as->rank = 1;
   param_sym->as->lower[0] = gfc_get_int_expr (gfc_default_integer_kind,
                                              NULL, 1);