aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2005-11-21 16:05:58 +0000
committerPaul Thomas <pault@gcc.gnu.org>2005-11-21 16:05:58 +0000
commitb95605fb0c2052fcd1c2239acaa58748c9efc687 (patch)
treefa5a3b80e00abb2726bdd692a6e324db16c02eb7 /gcc/fortran
parent078152a256a43a888048dcec5e2c6d503db5b75c (diff)
downloadgcc-b95605fb0c2052fcd1c2239acaa58748c9efc687.zip
gcc-b95605fb0c2052fcd1c2239acaa58748c9efc687.tar.gz
gcc-b95605fb0c2052fcd1c2239acaa58748c9efc687.tar.bz2
re PR fortran/24223 (Gfortran crashes in two places)
2005-11-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/24223 * resolve.c (resolve_contained_fntype) Error if an internal function is assumed character length. PR fortran/24705 * trans-decl.c (gfc_create_module_variable) Skip ICE in when backend decl has been built and the symbol is marked as being in an equivalence statement. 2005-11-21 Paul Thomas <pault@gcc.gnu.org PR fortran/24223 * gfortran.dg/substring_equivalence.f90: New test. PR fortran/24705 * gfortran.dg/auto_internal_assumed.f90: New test. From-SVN: r107310
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog11
-rw-r--r--gcc/fortran/resolve.c13
-rw-r--r--gcc/fortran/trans-decl.c3
3 files changed, 26 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 1d7f9cf7..355430d 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,14 @@
+2005-11-21 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/24223
+ * resolve.c (resolve_contained_fntype) Error if an internal
+ function is assumed character length.
+
+ PR fortran/24705
+ * trans-decl.c (gfc_create_module_variable) Skip ICE in
+ when backend decl has been built and the symbol is marked
+ as being in an equivalence statement.
+
2005-11-20 Toon Moene <toon@moene.indiv.nluug.nl>
* invoke.texi: Remove superfluous @item.
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 0f17585..cb9c65b 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -294,6 +294,19 @@ resolve_contained_fntype (gfc_symbol * sym, gfc_namespace * ns)
sym->attr.untyped = 1;
}
}
+
+ /*Fortran 95 Draft Standard, page 51, Section 5.1.1.5, on the Character type,
+ lists the only ways a character length value of * can be used: dummy arguments
+ of proceedures, named constants, and function results in external functions.
+ Internal function results are not on that list; ergo, not permitted. */
+
+ if (sym->ts.type == BT_CHARACTER)
+ {
+ gfc_charlen *cl = sym->ts.cl;
+ if (!cl || !cl->length)
+ gfc_error ("Character-valued internal function '%s' at %L must "
+ "not be assumed length", sym->name, &sym->declared_at);
+ }
}
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 04f037b..37e9db8 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -2366,7 +2366,8 @@ gfc_create_module_variable (gfc_symbol * sym)
return;
/* Equivalenced variables arrive here after creation. */
- if (sym->backend_decl && sym->equiv_built)
+ if (sym->backend_decl
+ && (sym->equiv_built || sym->attr.in_equivalence))
return;
if (sym->backend_decl)