PR fortran/13467

Paul Brook paul@codesourcery.com
Sat Jan 10 16:59:00 GMT 2004


On Friday 02 January 2004 12:42 am, HUANG Chun wrote:
> Hi,
>
> PR fortran/13467 is fixed.
>
> Huang Chun
>
> =========
> 2003-12-31  Huang Chun <chunhuang73@hotmail.com>
>
>         PR fortran/13467
>         * trans-decl.c (gfc_create_module_variable):  Array with parameter
> attributes
>         should be output.

We still don't want to try to output array valued procedures. Applied as 
follows:

Index: trans-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/Attic/trans-decl.c,v
retrieving revision 1.1.2.28
diff -u -p -r1.1.2.28 trans-decl.c
--- trans-decl.c	1 Jan 2004 12:09:12 -0000	1.1.2.28
+++ trans-decl.c	10 Jan 2004 16:46:27 -0000
@@ -1611,6 +1611,9 @@ gfc_trans_deferred_vars (gfc_symbol * pr
   return fnbody;
 }
 
+
+/* Output an initialized decl for a module variable.  */
+
 static void
 gfc_create_module_variable (gfc_symbol * sym)
 {
@@ -1624,8 +1627,13 @@ gfc_create_module_variable (gfc_symbol *
       internal_error ("module symbol %s in wrong namespace", sym->name);
     }
 
-  /* Only output variables.  */
-  if (sym->attr.flavor != FL_VARIABLE || sym->attr.common)
+  /* Don't ouptut symbols from common blocks.  */
+  if (sym->attr.common)
+    return;
+
+  /* Only output variables and array valued parametes.  */
+  if (sym->attr.flavor != FL_VARIABLE
+      && (sym->attr.flavor != FL_PARAMETER || sym->attr.dimension == 0))
     return;
 
   /* Don't generate variables from other modules.  */



More information about the Gcc-patches mailing list