Factor access to the common block head symbol
authorMikael Morin <mikael@gcc.gnu.org>
Sun, 4 Oct 2015 12:07:50 +0000 (12:07 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Sun, 4 Oct 2015 12:07:50 +0000 (12:07 +0000)
* resolve.c (resolve_common_vars): Move access to the common
block's head symbol inside the function.
(resolve_common_blocks, resolve_types): Update callers.

From-SVN: r228456

gcc/fortran/ChangeLog
gcc/fortran/resolve.c

index 1e9435550f5903a55a62a393170efce9ad8a121f..014d67c621f7cbbf12c546ff1e2a28a70ac40587 100644 (file)
@@ -1,3 +1,9 @@
+2015-10-04  Mikael Morin  <mikael@gcc.gnu.org>
+
+       * resolve.c (resolve_common_vars): Move access to the common
+       block's head symbol inside the function.
+       (resolve_common_blocks, resolve_types): Update callers.
+
 2015-10-01  Louis Krupp <louis.krupp@zoho.com>
 
        PR fortran/62242
index 5822cb0e43583abad4f8659f17fbfebc86904bae..614d8a99072cc4f22f7b6f1d808f419d6804853b 100644 (file)
@@ -912,9 +912,9 @@ resolve_entries (gfc_namespace *ns)
 
 /* Resolve common variables.  */
 static void
-resolve_common_vars (gfc_symbol *sym, bool named_common)
+resolve_common_vars (gfc_common_head *common_block, bool named_common)
 {
-  gfc_symbol *csym = sym;
+  gfc_symbol *csym = common_block->head;
 
   for (; csym; csym = csym->common_next)
     {
@@ -972,7 +972,7 @@ resolve_common_blocks (gfc_symtree *common_root)
   if (common_root->right)
     resolve_common_blocks (common_root->right);
 
-  resolve_common_vars (common_root->n.common->head, true);
+  resolve_common_vars (common_root->n.common, true);
 
   /* The common name is a global name - in Fortran 2003 also if it has a
      C binding name, since Fortran 2008 only the C binding name is a global
@@ -15289,7 +15289,7 @@ resolve_types (gfc_namespace *ns)
 
   resolve_entries (ns);
 
-  resolve_common_vars (ns->blank_common.head, false);
+  resolve_common_vars (&ns->blank_common, false);
   resolve_common_blocks (ns->common_root);
 
   resolve_contained_functions (ns);