re PR fortran/31630 (ICE on nasty derived types code)
authorPaul Thomas <pault@gcc.gnu.org>
Tue, 8 May 2007 14:40:58 +0000 (14:40 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Tue, 8 May 2007 14:40:58 +0000 (14:40 +0000)
2007-05-08  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/31630
* resolve.c (resolve_symbol): Remove the flagging mechanism from the
formal namespace resolution and instead check that the formal
namespace is not the current namespace.

From-SVN: r124550

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

index 3fc67d70405035953540753e740d16686a52aa83..36137451ec62d1671c5ccd4665168ebd420cdd25 100644 (file)
@@ -1,3 +1,10 @@
+2007-05-08  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/31630
+       * resolve.c (resolve_symbol): Remove the flagging mechanism from the
+       formal namespace resolution and instead check that the formal
+       namespace is not the current namespace.
+
 2007-05-08  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/31692
index 4ec9a921c4ac6dc15eb27c297450e6d1faead257..5c5d40bf6d5c60be8b42d765650862c0b413d7f4 100644 (file)
@@ -6136,9 +6136,7 @@ resolve_fl_parameter (gfc_symbol *sym)
 static void
 resolve_symbol (gfc_symbol *sym)
 {
-  /* Zero if we are checking a formal namespace.  */
-  static int formal_ns_flag = 1;
-  int formal_ns_save, check_constant, mp_flag;
+  int check_constant, mp_flag;
   gfc_symtree *symtree;
   gfc_symtree *this_symtree;
   gfc_namespace *ns;
@@ -6345,18 +6343,9 @@ resolve_symbol (gfc_symbol *sym)
 
   formal_arg_flag = 0;
 
-  /* Resolve formal namespaces.  The symbols in formal namespaces that
-     themselves are from procedures in formal namespaces will not stand
-     resolution, except when they are use associated.
-     TODO: Fix the symbols in formal namespaces so that resolution can
-     be done unconditionally.  */
-  if (formal_ns_flag && sym != NULL && sym->formal_ns != NULL)
-    {
-      formal_ns_save = formal_ns_flag;
-      formal_ns_flag = sym->attr.use_assoc ? 1 : 0;
-      gfc_resolve (sym->formal_ns);
-      formal_ns_flag = formal_ns_save;
-    }
+  /* Resolve formal namespaces.  */
+  if (sym->formal_ns && sym->formal_ns != gfc_current_ns)
+    gfc_resolve (sym->formal_ns);
 
   /* Check threadprivate restrictions.  */
   if (sym->attr.threadprivate && !sym->attr.save