aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 6192e68..1379426 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2699,6 +2699,9 @@ gfc_scalar_elemental_arg_saved_as_reference (gfc_ss_info * ss_info)
if (ss_info->type != GFC_SS_REFERENCE)
return false;
+ if (ss_info->data.scalar.needs_temporary)
+ return false;
+
/* If the actual argument can be absent (in other words, it can
be a NULL reference), don't try to evaluate it; pass instead
the reference directly. */
@@ -10515,6 +10518,8 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
{
gfc_ref *ref;
+ gfc_fix_class_refs (expr);
+
for (ref = expr->ref; ref; ref = ref->next)
if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT)
break;