This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]