aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2013-06-13 14:26:47 +0000
committerMikael Morin <mikael@gcc.gnu.org>2013-06-13 14:26:47 +0000
commit37ea263afa8f68bc7a6fcda19a47eb645624ecb7 (patch)
tree72e6325d1a51b2eab4943e585e211866a24869c3 /gcc/fortran/trans-expr.c
parente5b962d0ccb213b6ad1f2ba4d6a0b84c9e94b046 (diff)
downloadgcc-37ea263afa8f68bc7a6fcda19a47eb645624ecb7.zip
gcc-37ea263afa8f68bc7a6fcda19a47eb645624ecb7.tar.gz
gcc-37ea263afa8f68bc7a6fcda19a47eb645624ecb7.tar.bz2
re PR fortran/49074 ([OOP] Defined assignment w/ CLASS arrays: Incomplete error message)
fortran/ PR fortran/49074 * trans-expr.c (gfc_conv_variable): Don't walk the reference chain. Handle NULL array references. (gfc_conv_procedure_call): Remove code handling NULL array references. testsuite/ PR fortran/49074 * gfortran.dg/typebound_assignment_5.f03: New. From-SVN: r200069
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 9d07345..bd8886c 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1761,9 +1761,12 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
/* A scalarized term. We already know the descriptor. */
se->expr = ss_info->data.array.descriptor;
se->string_length = ss_info->string_length;
- for (ref = ss_info->data.array.ref; ref; ref = ref->next)
- if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT)
- break;
+ ref = ss_info->data.array.ref;
+ if (ref)
+ gcc_assert (ref->type == REF_ARRAY
+ && ref->u.ar.type != AR_ELEMENT);
+ else
+ gfc_conv_tmp_array_ref (se);
}
else
{
@@ -4041,23 +4044,11 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_init_se (&parmse, se);
parm_kind = ELEMENTAL;
- if (ss->dimen > 0 && e->expr_type == EXPR_VARIABLE
- && ss->info->data.array.ref == NULL)
- {
- gfc_conv_tmp_array_ref (&parmse);
- if (e->ts.type == BT_CHARACTER)
- gfc_conv_string_parameter (&parmse);
- else
- parmse.expr = gfc_build_addr_expr (NULL_TREE, parmse.expr);
- }
- else
- {
- gfc_conv_expr_reference (&parmse, e);
- if (e->ts.type == BT_CHARACTER && !e->rank
- && e->expr_type == EXPR_FUNCTION)
- parmse.expr = build_fold_indirect_ref_loc (input_location,
- parmse.expr);
- }
+ gfc_conv_expr_reference (&parmse, e);
+ if (e->ts.type == BT_CHARACTER && !e->rank
+ && e->expr_type == EXPR_FUNCTION)
+ parmse.expr = build_fold_indirect_ref_loc (input_location,
+ parmse.expr);
if (fsym && fsym->ts.type == BT_DERIVED
&& gfc_is_class_container_ref (e))