aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobi@gcc.gnu.org>2005-03-04 22:03:46 +0100
committerTobias Schlüter <tobi@gcc.gnu.org>2005-03-04 22:03:46 +0100
commit3852e8b8f21397fc719ef45ba404a58bed53a7d0 (patch)
treef0571636b2dcf97f0a36a47d2d17869b234b465f /gcc/fortran/trans-expr.c
parenta873fcb4353a4d03318eecec0252c344d2cd3a77 (diff)
downloadgcc-3852e8b8f21397fc719ef45ba404a58bed53a7d0.zip
gcc-3852e8b8f21397fc719ef45ba404a58bed53a7d0.tar.gz
gcc-3852e8b8f21397fc719ef45ba404a58bed53a7d0.tar.bz2
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
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c3
1 files changed, 2 insertions, 1 deletions
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