aboutsummaryrefslogtreecommitdiff
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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 9452e27..7b41c65 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -4115,7 +4115,13 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
parmse.expr = gfc_build_addr_expr (NULL_TREE, parmse.expr);
}
else
- gfc_conv_expr_reference (&parmse, e);
+ {
+ 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))