------- Comment #10 from pault at gcc dot gnu dot org  2007-11-01 18:07 -------
FX,

I believe that the fix is something like:

Index: gcc/fortran/trans-array.c
===================================================================
*** gcc/fortran/trans-array.c   (revision 129505)
--- gcc/fortran/trans-array.c   (working copy)
*************** gfc_conv_array_parameter (gfc_se * se, g
*** 4965,4972 ****
    if (expr->expr_type == EXPR_ARRAY && expr->ts.type == BT_CHARACTER)
      {
        get_array_ctor_strlen (&se->pre, expr->value.constructor, &tmp);
!       expr->ts.cl->backend_decl = gfc_evaluate_now (tmp, &se->pre);
!       se->string_length = expr->ts.cl->backend_decl;
      }

    /* Is this the result of the enclosing procedure?  */
--- 4972,4979 ----
    if (expr->expr_type == EXPR_ARRAY && expr->ts.type == BT_CHARACTER)
      {
        get_array_ctor_strlen (&se->pre, expr->value.constructor, &tmp);
!       expr->ts.cl->backend_decl = tmp;
!       se->string_length = gfc_evaluate_now (tmp, &se->pre);
      }

    /* Is this the result of the enclosing procedure?  */

Fixing the value of a cl->backend_decl has the observed consequences because,
in some cases like this one, the expr->ts.cl is a copy of a variable cl.

This survives dg.expr=gfortran.dg/char* but beyond that I am not in a position
to go.

Please make use of it as you will.

Cheers

Paul

PS It's my fault!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33881

Reply via email to