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]

[gfortran] ICE with common blocks


Patch below fixes an ICE when using COMMON blocks in modules. We were trying 
to explicity create a variable from the symbol for the common block iteslf.

Tested on i686-linux
Applied to tree-ssa branch.

Paul

2003-11-24  Paul Brook  <paul@nowt.org>

	PR fortran/13154
	* trans-decl.c (gfc_greate_module_variable): Skip COMMON blocks.
testsuite
	* gfortran.fortran-torture/compile/module_common.f90: New test.

--- clean/tree-ssa/gcc/fortran/trans-decl.c
+++ gcc/gcc/fortran/trans-decl.c
@@ -1663,7 +1663,7 @@ gfc_create_module_variable (gfc_symbol *
     }
 
   /* Only output variables.  */
-  if (sym->attr.flavor != FL_VARIABLE)
+  if (sym->attr.flavor != FL_VARIABLE || sym->attr.common)
     return;
 
   /* Don't generate variables from other modules.  */


Attachment: module_common.f90
Description: Text document


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