This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran, 4.5] PR38290: procedure pointer assignment checking
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 6 Apr 2009 14:26:39 +0200
- Subject: Re: [Patch, Fortran, 4.5] PR38290: procedure pointer assignment checking
- References: <854832d40812111409n51caaec6w1704302984b1fa71@mail.gmail.com>
2008/12/11 Janus Weil <janus@gcc.gnu.org>:
> Hi all,
>
> here comes my patch for PR38290. This fixes a couple of issues related
> to PROCEDURE statements with intrinsic interfaces:
>
> PROCEDURE(sin) :: p
>
> For these the interface of the intrinsic is now correctly transferred
> to the procedure symbol (the formal args were not copied at all, and
> the typespec was copied too late).
>
> In addition the interface check for procptr assignments has been
> re-enabled. This check is done via gfc_compare_interfaces, which was
> modified to also handle intrinsics.
>
> Regtested on i686-pc-linux-gnu. Ok for 4.5?
Here is an update to this patch. The only change since December is a
small modification to the test case proc_ptr_13.f90, which failed with
the patch applied. Ok for trunk?
Cheers,
Janus
2009-04-06 Janus Weil <janus@gcc.gnu.org>
PR fortran/38920
* expr.c (gfc_check_pointer_assign): Enable interface check for
procedure pointers.
* gfortran.h: Add copy_formal_args_intr.
* interface.c (gfc_compare_interfaces): Call gfc_compare_intr_interfaces
if second argument is an intrinsic.
(compare_intr_interfaces): Correctly set attr.function, attr.subroutine
and ts.
(compare_parameter): Call gfc_compare_interfaces also for intrinsics.
* resolve.c (resolve_specific_f0,resolve_specific_s0): Don't resolve
intrinsic interfaces here. Must happen earlier.
(resolve_symbol): Resolution of intrinsic interfaces moved here from
resolve_specific_..., and formal args are now copied from intrinsic
interfaces.
* symbol.c (copy_formal_args_intr): New function to copy the formal
arguments from an intinsic procedure.
2009-04-06 Janus Weil <janus@gcc.gnu.org>
PR fortran/38920
* gfortran.dg/proc_decl_1.f90: Modified.
* gfortran.dg/proc_ptr_11.f90: Extended.
* gfortran.dg/proc_ptr_13.f90: Modified.