diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2007-05-08 14:40:58 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2007-05-08 14:40:58 +0000 |
commit | a34437a1da009486cdd38e8ea74b3d0c42022a10 (patch) | |
tree | 887b0b786c6f93ded3510a3ce8a8a2b2631f9152 | |
parent | b2b247f9864d751c6ebf696292b93b477d2c6c96 (diff) | |
download | gcc-a34437a1da009486cdd38e8ea74b3d0c42022a10.zip gcc-a34437a1da009486cdd38e8ea74b3d0c42022a10.tar.gz gcc-a34437a1da009486cdd38e8ea74b3d0c42022a10.tar.bz2 |
re PR fortran/31630 (ICE on nasty derived types code)
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
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 19 |
2 files changed, 11 insertions, 15 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3fc67d7..3613745 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,12 @@ 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 * trans-array.c (gfc_conv_array_parameter): Convert full array references to the result of the procedure enclusing the call. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 4ec9a92..5c5d40b 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -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 |