From 3852e8b8f21397fc719ef45ba404a58bed53a7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Schl=C3=BCter?= Date: Fri, 4 Mar 2005 22:03:46 +0100 Subject: re PR fortran/19673 (pointer function with RESULT specified returns pointer to "ptr" rather than "*ptr") fortran/ PR fortran/19673 * trans-expr.c (gfc_conv_function_call): Correctly dereference argument from a pointer function also if it has a result clause. testsuite/ PR fortran/19673 * gfortran.dg/func_result_1.f90: New test. From-SVN: r95901 --- gcc/fortran/trans-expr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/trans-expr.c') diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 685a9f9..b79d074 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1220,7 +1220,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, something like x = f() where f is pointer valued, we have to dereference the result. */ - if (sym->attr.pointer && !se->want_pointer && !byref) + if (!se->want_pointer && !byref + && (sym->attr.pointer || (sym->result && sym->result->attr.pointer))) se->expr = gfc_build_indirect_ref (se->expr); /* A pure function may still have side-effects - it may modify its -- cgit v1.1