[Patch, Fortran] PR 45366: Problem with procedure pointer dummy in PURE function
Janus Weil
janus@gcc.gnu.org
Mon Aug 23 09:46:00 GMT 2010
Hi all,
here is the fix for a problem with procedure pointers being used as
dummy arguments.
The problem was the the checks (on pureness) in
'resolve_formal_arglist' came too early, i.e. at a point where the
procptr was not marked as being pure yet. For procptr symbols we copy
over the attributes of the interface in 'resolve_symbol'. My first
idea was to just call 'resolve_symbol' in 'resolve_formal_arglist',
but this gave quite a number of regressions in various unrelated
areas. Therefore I decided to separate out the code which copies the
interface properties to the procptr symbol (now called
'resolve_procedure_interface'), and call this from
'resolve_formal_arglist'.
The patch was regtested on x86_64-unknown-linux-gnu. I think it's
pretty much obvious. Ok for trunk?
Cheers,
Janus
2010-08-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/45366
* resolve.c (resolve_procedure_interface): New function split off from
'resolve_symbol'.
(resolve_formal_arglist): Call it here ...
(resolve_symbol): ... and here.
2010-08-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/45366
* gfortran.dg/proc_ptr_29.f90: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr45366_v2.diff
Type: application/octet-stream
Size: 6765 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100823/210d9ea6/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proc_ptr_29.f90
Type: application/octet-stream
Size: 564 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100823/210d9ea6/attachment-0001.obj>
More information about the Fortran
mailing list