aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2009-07-24 13:00:01 +0200
committerJanus Weil <janus@gcc.gnu.org>2009-07-24 13:00:01 +0200
commitbfce226c16841059130f0dff32da251a6999fa16 (patch)
tree2f7e8f299953745e765d7fe3393df09fcc8c678a /gcc/fortran/expr.c
parent223cf84d33ea674610bb78cf88017a1e8c3e1d06 (diff)
downloadgcc-bfce226c16841059130f0dff32da251a6999fa16.zip
gcc-bfce226c16841059130f0dff32da251a6999fa16.tar.gz
gcc-bfce226c16841059130f0dff32da251a6999fa16.tar.bz2
re PR fortran/40822 (Internal compiler error when Fortran intrinsic LEN referenced before explicit declaration)
2009-07-24 Janus Weil <janus@gcc.gnu.org> PR fortran/40822 * array.c (gfc_resolve_character_array_constructor): Use new function gfc_new_charlen. * decl.c (add_init_expr_to_sym,variable_decl,match_char_spec, gfc_match_implicit): Ditto. * expr.c (gfc_simplify_expr): Ditto. * gfortran.h (gfc_new_charlen): New prototype. * iresolve.c (check_charlen_present,gfc_resolve_char_achar): Use new function gfc_new_charlen. * module.c (mio_charlen): Ditto. * resolve.c (gfc_resolve_substring_charlen, gfc_resolve_character_operator,fixup_charlen,resolve_fl_derived, resolve_symbol): Ditto. * symbol.c (gfc_new_charlen): New function to create a new gfc_charlen structure and add it to a namespace. (gfc_copy_formal_args_intr): Make sure ts.cl is present for CHARACTER variables. 2009-07-24 Janus Weil <janus@gcc.gnu.org> PR fortran/40822 * gfortran.dg/char_length_16.f90: New. From-SVN: r150047
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index a8f9f6a..df399b9 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -1681,9 +1681,7 @@ gfc_simplify_expr (gfc_expr *p, int type)
gfc_free (p->value.character.string);
p->value.character.string = s;
p->value.character.length = end - start;
- p->ts.cl = gfc_get_charlen ();
- p->ts.cl->next = gfc_current_ns->cl_list;
- gfc_current_ns->cl_list = p->ts.cl;
+ p->ts.cl = gfc_new_charlen (gfc_current_ns);
p->ts.cl->length = gfc_int_expr (p->value.character.length);
gfc_free_ref_list (p->ref);
p->ref = NULL;