http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59107

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |janus at gcc dot gnu.org

--- Comment #8 from janus at gcc dot gnu.org ---
The following patch fixes it (and regtests cleanly):


Index: gcc/fortran/gfortran.h
===================================================================
--- gcc/fortran/gfortran.h    (revision 204922)
+++ gcc/fortran/gfortran.h    (working copy)
@@ -1250,7 +1250,7 @@ typedef struct gfc_symbol
   /* Set if this variable is used as an index name in a FORALL.  */
   unsigned forall_index:1;
   /* Used to avoid multiple resolutions of a single symbol.  */
-  unsigned resolved:1;
+  unsigned resolved:2;

   int refs;
   struct gfc_namespace *ns;    /* namespace containing this symbol */
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c    (revision 204922)
+++ gcc/fortran/resolve.c    (working copy)
@@ -1619,8 +1619,9 @@ gfc_resolve_intrinsic (gfc_symbol *sym, locus *loc
   gfc_intrinsic_sym* isym = NULL;
   const char* symstd;

-  if (sym->formal)
+  if (sym->resolved>=2)
     return true;
+  sym->resolved = 2;

   /* Already resolved.  */
   if (sym->from_intmod && sym->ts.type != BT_UNKNOWN)
@@ -12699,7 +12700,7 @@ resolve_symbol (gfc_symbol *sym)
   gfc_array_spec *as;
   bool saved_specification_expr;

-  if (sym->resolved)
+  if (sym->resolved>=1)
     return;
   sym->resolved = 1;

Reply via email to