This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran, 4.5] PR38290: procedure pointer assignment checking
Janus Weil wrote:
> 2009/4/6 Janus Weil <janus@gcc.gnu.org>:
>
>> 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.
>>
>>
Looks OK. Thanks for the checking patch. Next comes then the
proc-pointer-as-function-return patch, I assume? Then only the
proc-pointer-components-with-NOPASS and with PASS are missing, or is
there something else?
Tobias
>> 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.
>>
>>