This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] Fix PR 15211
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: GCC Fortran mailing list <fortran at gcc dot gnu dot org>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 31 May 2004 20:54:31 +0200
- Subject: [gfortran] Fix PR 15211
Looking again at the code in gfc_conv_intrinsic_len it occurred to me
that all strings in an array must be of the same length. Therefor this
one line fix should do the trick. The test for arg->ref == NULL is
clearly meant to separate the case of arg->ref == REF_SUBSTRING, but is
meaningless in the case of REF_ARRAY or REF_COMPONENT (which I will look
into after this is approved).
- Tobi
2004-05-31 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* trans-intrinsic.c (gfc_conv_intrinsic_len): Deal with arrays
of strings.
Index: trans-intrinsic.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-intrinsic.c,v
retrieving revision 1.5
diff -u -p -r1.5 trans-intrinsic.c
--- trans-intrinsic.c 14 May 2004 15:32:01 -0000 1.5
+++ trans-intrinsic.c 31 May 2004 18:48:57 -0000
@@ -1874,7 +1874,8 @@ gfc_conv_intrinsic_len (gfc_se * se, gfc
break;
default:
- if (arg->expr_type == EXPR_VARIABLE && arg->ref == NULL)
+ if (arg->expr_type == EXPR_VARIABLE
+ && (arg->ref == NULL || arg->ref->type == REF_ARRAY))
{
sym = arg->symtree->n.sym;
decl = gfc_get_symbol_decl (sym);