aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2006-10-31 06:03:24 +0000
committerPaul Thomas <pault@gcc.gnu.org>2006-10-31 06:03:24 +0000
commitdd5797cc36028b51596c88d0b5ecc1f0a2902488 (patch)
treea2f3d9751ac9c0b7ae6f8b76727cb0d066e270f5 /gcc/fortran/trans-expr.c
parente5c18c3c298de538f6a9acec3120b63d830dc307 (diff)
downloadgcc-dd5797cc36028b51596c88d0b5ecc1f0a2902488.zip
gcc-dd5797cc36028b51596c88d0b5ecc1f0a2902488.tar.gz
gcc-dd5797cc36028b51596c88d0b5ecc1f0a2902488.tar.bz2
re PR fortran/29387 (ICE on character array function of variable length)
2006-10-31 Paul Thomas <pault@gcc.gnu.org> 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 <pault@gcc.gnu.org> 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
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c11
1 files changed, 9 insertions, 2 deletions
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));