PR fortran/42072
* trans-expr.c (gfc_conv_procedure_call): Handle procedure pointer
dummies which are passed to C_F_PROCPOINTER.
2009-11-18 Janus Weil <janus@gcc.gnu.org>
PR fortran/42072
* gfortran.dg/proc_ptr_8.f90: Extended.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154292
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-11-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/42072
+ * trans-expr.c (gfc_conv_procedure_call): Handle procedure pointer
+ dummies which are passed to C_F_PROCPOINTER.
+
2009-11-18 Alexandre Oliva <aoliva@redhat.com>
* module.c (mio_f2k_derived): Initialize op.
gfc_conv_expr (&fptrse, arg->next->expr);
gfc_add_block_to_block (&se->pre, &fptrse.pre);
gfc_add_block_to_block (&se->post, &fptrse.post);
-
- if (gfc_is_proc_ptr_comp (arg->next->expr, NULL))
- tmp = gfc_get_ppc_type (arg->next->expr->ref->u.c.component);
- else
- tmp = TREE_TYPE (arg->next->expr->symtree->n.sym->backend_decl);
- se->expr = fold_build2 (MODIFY_EXPR, tmp, fptrse.expr,
- fold_convert (tmp, cptrse.expr));
+
+ if (arg->next->expr->symtree->n.sym->attr.proc_pointer
+ && arg->next->expr->symtree->n.sym->attr.dummy)
+ fptrse.expr = build_fold_indirect_ref_loc (input_location,
+ fptrse.expr);
+
+ se->expr = fold_build2 (MODIFY_EXPR, TREE_TYPE (fptrse.expr),
+ fptrse.expr,
+ fold_convert (TREE_TYPE (fptrse.expr),
+ cptrse.expr));
return 0;
}
+2009-11-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/42072
+ * gfortran.dg/proc_ptr_8.f90: Extended.
+
2009-11-18 Shujing Zhao <pearly.zhao@oracle.com>
* g++.old-deja/g++.other/crash28.C: Make expected dg-error strings
END MODULE X
USE X
-PROCEDURE(mytype), POINTER :: ptype
+PROCEDURE(mytype), POINTER :: ptype,ptype2
CALL init()
CALL C_F_PROCPOINTER(funpointer,ptype)
if (ptype(3) /= 9) call abort()
+! the stuff below was added with PR 42072
+call setpointer(ptype2)
+if (ptype2(4) /= 12) call abort()
+
+contains
+
+ subroutine setpointer (p)
+ PROCEDURE(mytype), POINTER :: p
+ CALL C_F_PROCPOINTER(funpointer,p)
+ end subroutine
+
END
! { dg-final { cleanup-modules "X" } }