diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2006-03-01 22:24:19 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2006-03-01 22:24:19 +0000 |
commit | 61321991ff5f055015750ddf36444705b9921464 (patch) | |
tree | 1fb7018901bd09ec73d55b0ccf66775cd2947e62 /gcc/fortran/trans-common.c | |
parent | 8acb1b3d1c6369349372f74e815db2375ea8e0c5 (diff) | |
download | gcc-61321991ff5f055015750ddf36444705b9921464.tar.gz |
re PR fortran/26393 (ICE with function returning variable lenght array)
2006-03-01 Paul Thomas <pault@gcc.gnu.org>
* iresolve.c (gfc_resolve_dot_product): Remove any difference in
treatment of logical types.
* trans-intrinsic.c (gfc_conv_intrinsic_dot_product): New function.
PR fortran/26393
* trans-decl.c (gfc_get_symbol_decl): Extend condition that symbols
must be referenced to include unreferenced symbols in an interface
body.
PR fortran/20938
* trans-array.c (gfc_conv_resolve_dependencies): Add call to
gfc_are_equivalenced_arrays.
* symbol.c (gfc_free_equiv_infos, gfc_free_equiv_lists): New
functions. (gfc_free_namespace): Call them.
* trans-common.c (copy_equiv_list_to_ns): New function.
(add_equivalences): Call it.
* gfortran.h: Add equiv_lists to gfc_namespace and define
gfc_equiv_list and gfc_equiv_info.
* dependency.c (gfc_are_equivalenced_arrays): New function.
(gfc_check_dependency): Call it.
* dependency.h: Prototype for gfc_are_equivalenced_arrays.
2006-03-01 Paul Thomas <pault@gcc.gnu.org>
* gfortran.dg/logical_dot_product.f90: New test.
PR fortran/26393
* gfortran.dg/used_interface_ref.f90: New test.
PR fortran/20938
* gfortran.dg/dependency_2.f90: New test.
* gfortran.fortran-torture/execute/where17.f90: New test.
* gfortran.fortran-torture/execute/where18.f90: New test.
* gfortran.fortran-torture/execute/where19.f90: New test.
* gfortran.fortran-torture/execute/where20.f90: New test.
From-SVN: r111616
Diffstat (limited to 'gcc/fortran/trans-common.c')
-rw-r--r-- | gcc/fortran/trans-common.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 5d72a5086bc..3b34b334c2c 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -122,6 +122,7 @@ typedef struct segment_info static segment_info * current_segment; static gfc_namespace *gfc_common_ns = NULL; + /* Make a segment_info based on a symbol. */ static segment_info * @@ -144,6 +145,34 @@ get_segment_info (gfc_symbol * sym, HOST_WIDE_INT offset) return s; } + +/* Add a copy of a segment list to the namespace. This is specifically for + equivalence segments, so that dependency checking can be done on + equivalence group members. */ + +static void +copy_equiv_list_to_ns (segment_info *c) +{ + segment_info *f; + gfc_equiv_info *s; + gfc_equiv_list *l; + + l = (gfc_equiv_list *) gfc_getmem (sizeof (gfc_equiv_list)); + + l->next = c->sym->ns->equiv_lists; + c->sym->ns->equiv_lists = l; + + for (f = c; f; f = f->next) + { + s = (gfc_equiv_info *) gfc_getmem (sizeof (gfc_equiv_info)); + s->next = l->equiv; + l->equiv = s; + s->sym = f->sym; + s->offset = f->offset; + } +} + + /* Add combine segment V and segment LIST. */ static segment_info * @@ -787,6 +816,9 @@ add_equivalences (bool *saw_equiv) } } } + + /* Add a copy of this segment list to the namespace. */ + copy_equiv_list_to_ns (current_segment); } |