summaryrefslogtreecommitdiffstats
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 8c63b11b1a5..d1570a7dd2e 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1316,6 +1316,7 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping,
new_sym->attr.referenced = 1;
new_sym->attr.dimension = sym->attr.dimension;
new_sym->attr.pointer = sym->attr.pointer;
+ new_sym->attr.allocatable = sym->attr.allocatable;
new_sym->attr.flavor = sym->attr.flavor;
/* Create a fake symtree for it. */
@@ -1367,8 +1368,9 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping,
value = build_fold_indirect_ref (value);
}
- /* If the argument is a scalar or a pointer to an array, dereference it. */
- else if (!sym->attr.dimension || sym->attr.pointer)
+ /* If the argument is a scalar, a pointer to an array or an allocatable,
+ dereference it. */
+ else if (!sym->attr.dimension || sym->attr.pointer || sym->attr.allocatable)
value = build_fold_indirect_ref (se->expr);
/* For character(*), use the actual argument's descriptor. */
OpenPOWER on IntegriCloud