Louis,

A few comments:

(1) your patch fixes pr62242  and, as said in a previous mail, pr62246, 
pr60110, and some variants of pr52332. I have updated pr52332 and marked 
pr62246 and pr60110 as duplicate. Could you please add

    PR fortran/52332

to the ChangeLog entry?

(2) You need a ChangeLog entry for the tests in gcc/testsuite.

(3) The usual way to attract attention is a PING in the subject.

(4) AFAICT your patch boils down to

--- ../_clean/gcc/fortran/trans-array.c 2015-08-29 10:47:51.000000000 +0200
+++ gcc/fortran/trans-array.c   2015-09-15 15:21:16.000000000 +0200
@@ -1835,8 +1835,6 @@ get_array_ctor_all_strlen (stmtblock_t *
 
       gfc_add_block_to_block (block, &se.pre);
       gfc_add_block_to_block (block, &se.post);
-
-      e->ts.u.cl->backend_decl = *len;
     }
 }
 
@@ -2226,6 +2224,7 @@ trans_array_constructor (gfc_ss * ss, lo
   if (expr->ts.type == BT_CHARACTER)
     {
       bool const_string;
+      gfc_charlen *new_cl;
 
       /* get_array_ctor_strlen walks the elements of the constructor, if a
         typespec was given, we already know the string length and want the one
@@ -2251,7 +2250,9 @@ trans_array_constructor (gfc_ss * ss, lo
         and not end up here.  */
       gcc_assert (ss_info->string_length);
 
-      expr->ts.u.cl->backend_decl = ss_info->string_length;
+      new_cl = gfc_new_charlen (gfc_current_ns, expr->ts.u.cl);
+      new_cl->backend_decl = ss_info->string_length;
+      expr->ts.u.cl = new_cl;
 
       type = gfc_get_character_type_len (expr->ts.kind, 
ss_info->string_length);
       if (const_string)
@@ -2589,7 +2590,8 @@ gfc_add_loop_ss_code (gfc_loopinfo * loo
          if (expr->ts.type == BT_CHARACTER
              && ss_info->string_length == NULL
              && expr->ts.u.cl
-             && expr->ts.u.cl->length)
+             && expr->ts.u.cl->length
+             && expr->ts.u.cl->length->expr_type == EXPR_CONSTANT)
            {
              gfc_init_se (&se, NULL);
              gfc_conv_expr_type (&se, expr->ts.u.cl->length,

with two questions:

(a) Is the line

     e->ts.u.cl->backend_decl = *len;

 needed? It does not for my own tests (although this may be masked by errors or 
other ICEs)

(b) A long question for the hunk at 2251 I don’t understand (thus cannot 
answer).

Thanks for the patch,

Dominique

Reply via email to