diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2005-09-09 00:23:09 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2005-09-09 00:23:09 +0000 |
commit | 30aabb86ef4252ad2df0d3a56c364b824a2e5245 (patch) | |
tree | 64f996b2d8ca7299532cce4088ad6849a5133b49 /gcc/fortran/trans-decl.c | |
parent | 7afd4c375db57b7ca45338e83684d0504bc2c547 (diff) | |
download | gcc-30aabb86ef4252ad2df0d3a56c364b824a2e5245.zip gcc-30aabb86ef4252ad2df0d3a56c364b824a2e5245.tar.gz gcc-30aabb86ef4252ad2df0d3a56c364b824a2e5245.tar.bz2 |
re PR fortran/18878 ([4.0 only] erronous error message on vaild USE statement)
2005-09-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/18878
* module.c (find_use_name_n): Based on original
find_use_name. Either counts number of use names for a
given real name or returns use name n.
(find_use_name, number_use_names): Interfaces to the
function find_use_name_n.
(read_module): Add the logic and calls to these functions,
so that mutiple reuses of the same real name are loaded.
2005-09-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/22304
PR fortran/23270
PR fortran/18870
PR fortran/16511
PR fortran/17917
* gfortran.h: Move definition of BLANK_COMMON_NAME from trans-
common.c so that it is accessible to module.c. Add common_head
field to gfc_symbol structure. Add field for the equivalence
name AND new attr field, in_equivalence.
* match.c (gfc_match_common, gfc_match_equivalence): In loops
that flag common block equivalences, emit an error if the
common blocks are different, using sym->common_head as the
common block identifier. Ensure that symbols that are equivalence
associated with a common block are marked as being in_common.
* module.c (write_blank_common): New.
(write_common): Use unmangled common block name.
(load_equiv): New function ported from g95.
(read_module): Call load_equiv.
(write_equiv): New function ported from g95. Correct
string referencing for gfc functions. Give module
equivalences a unique name.
(write_module): Call write_equiv and write_blank_common.
* primary.c (match_variable) Old gfc_match_variable, made
static and third argument provided to indicate if parent
namespace to be visited or not.
(gfc_match_variable) New. Interface to match_variable.
(gfc_match_equiv_variable) New. Interface to match_variable.
* trans-common.c (finish_equivalences): Provide the call
to create_common with a gfc_common_header so that
module equivalences are made external, rather than local.
(find_equivalences): Ensure that all members in common block
equivalences are marked as used. This prevents the subsequent
call to this function from making local unions.
* trans-decl.c (gfc_generate_function_code): Move the call to
gfc_generate_contained_functions to after the call to
gfc_trans_common so the use-associated, contained common
blocks produce the correct references.
(gfc_create_module_variable): Return for equivalenced symbols
with existing backend declaration.
2005-09-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/18878
* gfortran.dg/module_double_reuse.f90: New.
2005-09-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/23270
PR fortran/22304
PR fortran/18870
PR fortran/17917
PR fortran/16511
* gfortran.dg/common_equivalence_1.f: New.
* gfortran.dg/common_equivalence_2.f: New.
* gfortran.dg/common_equivalence_3.f: New.
* gfortran.dg/contained_equivalence_1.f90: New.
* gfortran.dg/module_blank_common.f90: New.
* gfortran.dg/module_commons_1.f90: New.
* gfortran.dg/module_equivalence_1.f90: New.
* gfortran.dg/nested_modules_1.f90: New.
* gfortran.dg/g77/19990905-0.f: Remove XFAIL, rearrange
equivalences and add comment to connect the test with
the PR.
From-SVN: r104060
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r-- | gcc/fortran/trans-decl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index aaa4006..1b56840 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -2160,6 +2160,10 @@ gfc_create_module_variable (gfc_symbol * sym) if (sym->attr.use_assoc || sym->attr.in_common) return; + /* Equivalenced variables arrive here after creation. */ + if (sym->backend_decl && sym->equiv_built) + return; + if (sym->backend_decl) internal_error ("backend decl for module variable %s already exists", sym->name); @@ -2336,8 +2340,6 @@ gfc_generate_function_code (gfc_namespace * ns) gfc_start_block (&block); - gfc_generate_contained_functions (ns); - if (ns->entries && ns->proc_name->ts.type == BT_CHARACTER) { /* Copy length backend_decls to all entry point result @@ -2354,6 +2356,8 @@ gfc_generate_function_code (gfc_namespace * ns) /* Translate COMMON blocks. */ gfc_trans_common (ns); + gfc_generate_contained_functions (ns); + generate_local_vars (ns); current_function_return_label = NULL; |