This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37253] Segmentation fault with procedure pointer
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Aug 2008 20:30:14 -0000
- Subject: [Bug fortran/37253] Segmentation fault with procedure pointer
- References: <bug-37253-12313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2008-08-27 20:30 -------
call proc4( p )
should transfer to the tree code as
proc4(&p)
(procpointer passed by reference) but it is actually
proc(p)
The latter is OK for a PROCEDURE dummy argument but nor for a PROCEDURE POINTER
dummy argument.
I know we came across the pass-by-refence issue before when implementing
procpointers (cf. proc_ptr_7.f90). Why does not not work in this case? In
proc_ptr_7.f90 we have:
procedure(Integer(c_int)), pointer :: ptr
call foo(ptr)
with
subroutine foo(a)
procedure(integer(c_int)), pointer :: a
which produces:
foo (&ptr);
What is different here?
* * *
I think there is some issue with saving the information in the module. If one
moves proc4 to the main program (via contains) then it work, i.e. the
procpointer information is lost.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37253