https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104127

--- Comment #2 from anlauf at gcc dot gnu.org ---
We die here:

(gdb) l 7244
7239        case EXPR_ARRAY:
7240
7241          /* This is somewhat brutal. The expression for the first
7242             element of the array is evaluated and assigned to a
7243             new string length for the original expression.  */
7244          e = gfc_constructor_first (expr->value.constructor)->expr;
7245
7246          gfc_init_se (&tse, NULL);
7247
7248          /* Avoid evaluating trailing array references since all we need
is

(gdb) p expr->value.constructor
$45 = (gfc_constructor_base) 0x0
(gdb) p expr->ts.u.cl->length
$46 = (gfc_expr *) 0x0
(gdb) p *expr->shape[0]
$47 = {_mp_alloc = 1, _mp_size = 0, _mp_d = 0x2f0c840}

The shape is correct, but the character length is lost.
We could handle a zero-sized array but need the right spec.

Reply via email to