This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47240] [F03] segfault with procedure pointer component
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 10 Jan 2011 20:27:56 +0000
- Subject: [Bug fortran/47240] [F03] segfault with procedure pointer component
- Auto-submitted: auto-generated
- References: <bug-47240-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47240
--- Comment #3 from janus at gcc dot gnu.org 2011-01-10 20:27:29 UTC ---
Reduced test case:
type t
procedure (fun), pointer, nopass :: p
end type
type(t) :: x
x%p => fun
print *, evaluate (x%p)
contains
real function fun ()
fun = 0
end function
real function evaluate ( dummy )
procedure(fun) :: dummy
evaluate = dummy ()
end function
end
Like the original test case, this gives a segfault at runtime. Looking at the
dump, the wrong part is
D.1540 = evaluate (&x.p);
We should not take the address of x.p here, but just pass it as is.