diff options
author | Janus Weil <janus@gcc.gnu.org> | 2009-08-25 16:26:44 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2009-08-25 16:26:44 +0200 |
commit | 23878536a6b359865599d300c214bbb8fef83a43 (patch) | |
tree | 3af99476a57f873526e5deb43b0c56abfcee584b /gcc/fortran/primary.c | |
parent | 4df62c77fe216dd68b85f09d20910203e035efb2 (diff) | |
download | gcc-23878536a6b359865599d300c214bbb8fef83a43.zip gcc-23878536a6b359865599d300c214bbb8fef83a43.tar.gz gcc-23878536a6b359865599d300c214bbb8fef83a43.tar.bz2 |
re PR fortran/41139 (a procedure pointer call as actual argument)
2009-08-25 Janus Weil <janus@gcc.gnu.org>
PR fortran/41139
* primary.c (gfc_match_varspec): Make sure EXPR_PPC is only used for
calls to procedure pointer components, other references to procedure
pointer components are EXPR_VARIABLE.
* resolve.c (resolve_actual_arglist): Bugfix (there can be calls without
actual arglist).
* trans-expr.c (gfc_get_proc_ptr_comp): Renamed to 'get_proc_ptr_comp',
removed argument 'se' and made static. Avoid inserting a temporary
variable for calling the PPC.
(conv_function_val): Renamed gfc_get_proc_ptr_comp.
(gfc_conv_procedure_call): Distinguish functions returning a procedure
pointer from calls to a procedure pointer. Distinguish calls to
procedure pointer components from procedure pointer components as
actual arguments.
* trans-stmt.h (gfc_get_proc_ptr_comp): Make it static.
2009-08-25 Janus Weil <janus@gcc.gnu.org>
PR fortran/41139
* gfortran.dg/proc_ptr_25.f90: New.
* gfortran.dg/proc_ptr_comp_18.f90: New.
* gfortran.dg/proc_ptr_comp_19.f90: New.
From-SVN: r151081
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 0a917f7..79db195 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1839,13 +1839,12 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, if (component->attr.proc_pointer && ppc_arg && !gfc_matching_procptr_assignment) { - primary->expr_type = EXPR_PPC; - m = gfc_match_actual_arglist (component->attr.subroutine, + m = gfc_match_actual_arglist (sub_flag, &primary->value.compcall.actual); if (m == MATCH_ERROR) return MATCH_ERROR; - if (m == MATCH_NO) - primary->value.compcall.actual = NULL; + if (m == MATCH_YES) + primary->expr_type = EXPR_PPC; break; } |