From dd5797cc36028b51596c88d0b5ecc1f0a2902488 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Tue, 31 Oct 2006 06:03:24 +0000 Subject: re PR fortran/29387 (ICE on character array function of variable length) 2006-10-31 Paul Thomas PR fortran/29387 * trans-intrinsic.c (gfc_conv_intrinsic_len): Rearrange to have a specific case for EXPR_VARIABLE and, in default, build an ss to call gfc_conv_expr_descriptor for array expressions.. PR fortran/29490 * trans-expr.c (gfc_set_interface_mapping_bounds): In the case that GFC_TYPE_ARRAY_LBOUND is not available, use descriptor values for it and GFC_TYPE_ARRAY_UBOUND. PR fortran/29641 * trans-types.c (gfc_get_derived_type): If the derived type namespace has neither a parent nor a proc_name, set NULL for the search namespace. 2006-10-31 Paul Thomas PR fortran/29387 * gfortran.dg/intrinsic_actual_2.f90: New test. PR fortran/29490 * gfortran.dg/actual_array_interface_1.f90: New test. PR fortran/29641 * gfortran.dg/used_types_11.f90: New test. From-SVN: r118220 --- gcc/fortran/trans-expr.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/trans-expr.c') diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index e5c9f24..f4fcea5 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1296,10 +1296,17 @@ gfc_set_interface_mapping_bounds (stmtblock_t * block, tree type, tree desc) offset = gfc_index_zero_node; for (n = 0; n < GFC_TYPE_ARRAY_RANK (type); n++) { + dim = gfc_rank_cst[n]; GFC_TYPE_ARRAY_STRIDE (type, n) = gfc_conv_array_stride (desc, n); - if (GFC_TYPE_ARRAY_UBOUND (type, n) == NULL_TREE) + if (GFC_TYPE_ARRAY_LBOUND (type, n) == NULL_TREE) + { + GFC_TYPE_ARRAY_LBOUND (type, n) + = gfc_conv_descriptor_lbound (desc, dim); + GFC_TYPE_ARRAY_UBOUND (type, n) + = gfc_conv_descriptor_ubound (desc, dim); + } + else if (GFC_TYPE_ARRAY_UBOUND (type, n) == NULL_TREE) { - dim = gfc_rank_cst[n]; tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, gfc_conv_descriptor_ubound (desc, dim), gfc_conv_descriptor_lbound (desc, dim)); -- cgit v1.1