diff options
author | Janus Weil <janus@gcc.gnu.org> | 2009-07-24 13:00:01 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2009-07-24 13:00:01 +0200 |
commit | bfce226c16841059130f0dff32da251a6999fa16 (patch) | |
tree | 2f7e8f299953745e765d7fe3393df09fcc8c678a /gcc/fortran/iresolve.c | |
parent | 223cf84d33ea674610bb78cf88017a1e8c3e1d06 (diff) | |
download | gcc-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/iresolve.c')
-rw-r--r-- | gcc/fortran/iresolve.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index 619d7e9..fdbf40c 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -63,11 +63,7 @@ static void check_charlen_present (gfc_expr *source) { if (source->ts.cl == NULL) - { - source->ts.cl = gfc_get_charlen (); - source->ts.cl->next = gfc_current_ns->cl_list; - gfc_current_ns->cl_list = source->ts.cl; - } + source->ts.cl = gfc_new_charlen (gfc_current_ns); if (source->expr_type == EXPR_CONSTANT) { @@ -165,9 +161,7 @@ gfc_resolve_char_achar (gfc_expr *f, gfc_expr *x, gfc_expr *kind, f->ts.type = BT_CHARACTER; f->ts.kind = (kind == NULL) ? gfc_default_character_kind : mpz_get_si (kind->value.integer); - f->ts.cl = gfc_get_charlen (); - f->ts.cl->next = gfc_current_ns->cl_list; - gfc_current_ns->cl_list = f->ts.cl; + f->ts.cl = gfc_new_charlen (gfc_current_ns); f->ts.cl->length = gfc_int_expr (1); f->value.function.name = gfc_get_string (name, f->ts.kind, |