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]

Re: [gfortran] Fix PR 15211


Paul Brook wrote:

So, to make sure I understand correctly, checking (arg->ref == NULL || (arg->ref->next == NULL && arg->ref->type == REF_ARRAY)) should fix the

Yes, that would work. Patch approved with that change.

Below is what I committed after testing. I also added a check for this to execute/intrinsic_len.f90.


- Tobi

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/ChangeLog,v
retrieving revision 1.73
diff -u -p -r1.73 ChangeLog
--- ChangeLog   14 Jun 2004 16:04:39 -0000      1.73
+++ ChangeLog   14 Jun 2004 18:46:33 -0000
@@ -1,3 +1,9 @@
+2004-05-31  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/15211
+       * trans-intrinsic.c (gfc_conv_intrinsic_len): Deal with arrays
+       of strings.
+
 2004-06-14  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>

        PR fortran/15510
Index: trans-intrinsic.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-intrinsic.c,v
retrieving revision 1.6
diff -u -p -r1.6 trans-intrinsic.c
--- trans-intrinsic.c   12 Jun 2004 17:34:45 -0000      1.6
+++ trans-intrinsic.c   14 Jun 2004 18:46:33 -0000
@@ -1874,8 +1874,12 @@ 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->next == NULL && arg->ref->type == REF_ARRAY))
          {
+           /* This doesn't catch all cases.
+              See http://gcc.gnu.org/ml/fortran/2004-06/msg00165.html
+              and the surrounding thread.  */
            sym = arg->symtree->n.sym;
            decl = gfc_get_symbol_decl (sym);
            if (decl == current_function_decl && sym->attr.function


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