diff options
author | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-03-04 22:03:46 +0100 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-03-04 22:03:46 +0100 |
commit | 3852e8b8f21397fc719ef45ba404a58bed53a7d0 (patch) | |
tree | f0571636b2dcf97f0a36a47d2d17869b234b465f /gcc/fortran | |
parent | a873fcb4353a4d03318eecec0252c344d2cd3a77 (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b612122..db94aa6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,10 @@ -Steven G. Kargl <kargls@comcast.net> +2005-03-04 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> + + PR fortran/19673 + * trans-expr.c (gfc_conv_function_call): Correctly dereference + argument from a pointer function also if it has a result clause. + +2005-03-04 Steven G. Kargl <kargls@comcast.net> * expr.c (gfc_copy_shape_excluding): Change && to ||. 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 |