diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2009-08-04 12:41:08 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2009-08-04 12:41:08 +0000 |
commit | 51b128a0c02995a4fb6c615c92e20d2d969c8528 (patch) | |
tree | 52a4ff40e3bd532bfc1bf42cde6e76a369e3c229 /gcc/fortran | |
parent | b96fe38e469c9622c96f2e62b1db2590a2248338 (diff) | |
download | gcc-51b128a0c02995a4fb6c615c92e20d2d969c8528.zip gcc-51b128a0c02995a4fb6c615c92e20d2d969c8528.tar.gz gcc-51b128a0c02995a4fb6c615c92e20d2d969c8528.tar.bz2 |
re PR fortran/40875 (ICE with illegal type conversion)
2009-08-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40875
* decl.c (add_init_expr_to_sym): Character symbols can only be
initialized with character expressions.
2009-08-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40875
* gfortran.dg/initialization_23.f90 : New test.
From-SVN: r150454
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 45cec95..540d356 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2009-08-04 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/40875 + * decl.c (add_init_expr_to_sym): Character symbols can only be + initialized with character expressions. + 2009-08-02 Janus Weil <janus@gcc.gnu.org> PR fortran/40881 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 8dad9bf..86f41a3 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1253,9 +1253,13 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus) && gfc_check_assign_symbol (sym, init) == FAILURE) return FAILURE; - if (sym->ts.type == BT_CHARACTER && sym->ts.cl) + if (sym->ts.type == BT_CHARACTER && sym->ts.cl + && init->ts.type == BT_CHARACTER) { /* Update symbol character length according initializer. */ + if (gfc_check_assign_symbol (sym, init) == FAILURE) + return FAILURE; + if (sym->ts.cl->length == NULL) { int clen; |