[Patch, Fortran] PR 36704/38290

Janus Weil jaydub66@googlemail.com
Mon Dec 1 13:07:00 GMT 2008


Hi all,

this patch fixes two PRs (at least partially):

* PR 36704 - Procedure pointer as function result: This I was planning
to implement in 4.5, but when having a look at it over the weekend, I
found that certain cases (i.e. those using a RESULT statement, see
proc_ptr_12.f90) are really easy to implement, so maybe this could
still go into 4.4 (since it's more of a bugfix than a 'feature')? The
harder cases (without RESULT statement) I will then take care of
later.

* PR 38290 - Procedure pointer assignment checking: This adds a few
additional checks for procedure pointer assignments and fixes comment
#2 from the PR, including an ICE, so it's even a 4.4 regression.

The patch passes the testsuite on i686-pc-linux-gnu without
regressions. Ok for trunk?

Cheers,
Janus



2008-12-01  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/36704
	PR fortran/38290
	* decl.c (match_result): Result may be a standard variable or a
	procedure pointer.
	* expr.c (gfc_check_pointer_assign): Additional checks for procedure
	pointer assignments.
	* primary.c (gfc_match_rvalue): Bugfix for procedure pointer
	assignments.
	* resolve.c (resolve_function): Check for attr.subroutine.
	* trans-types.c (gfc_sym_type,gfc_get_function_type): Support
procedure pointers as function result.


2008-12-01  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/36704
	PR fortran/38290
	* gfortran.dg/entry_7.f90: Modified.
	* gfortran.dg/proc_ptr_2.f90: Extended.
	* gfortran.dg/proc_ptr_3.f90: Modified.
	* gfortran.dg/proc_ptr_11.f90: New.
	* gfortran.dg/proc_ptr_12.f90: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr36704.diff
Type: text/x-patch
Size: 6010 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20081201/9ce3749e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proc_ptr_11.f90
Type: application/octet-stream
Size: 636 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20081201/9ce3749e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proc_ptr_12.f90
Type: application/octet-stream
Size: 297 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20081201/9ce3749e/attachment-0001.obj>


More information about the Fortran mailing list