+2013-06-13 Mikael Morin <mikael@gcc.gnu.org>
+
+ 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.
+
2013-06-11 Tobias Burnus <burnus@net-b.de>
PR fortran/57535
/* 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
{
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))