This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32620] New: dummy procedure problem
- From: "danp57 at optonline dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jul 2007 02:57:41 -0000
- Subject: [Bug fortran/32620] New: dummy procedure problem
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I see a strange initialization problem. If I pass some function 'g' as an
argument fo another function 'wrap', I will get a bus error. If I call 'g'
from main before passing it as an argument, the code works correctly. In the
sample code, removing the two commented lines causes the call to 'wrap' to
work; leaving the comments produces the bus error. Sample code:
function wrap(x0, f) result(w)
real(8), intent(in):: x0
real(8):: w
interface
function f(x) result(r)
real(8), intent(in):: x
real(8):: r
end function f
end interface
w = f(x0)
return
end function wrap
function g(y) result(s)
real(8), intent(in):: y
real(8):: s
s = y * y
return
end function g
program m
real(8):: b
!b = g(2.0d00)
!print *, 'g(2.0d00) = ', b
b = wrap(3.0d00, g)
print *, 'wrap(3.0d00, g) = ', b
end program m
--
Summary: dummy procedure problem
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: danp57 at optonline dot net
GCC build triplet: i?86-mac-darwin
GCC host triplet: i?86-mac-darwin
GCC target triplet: i?86-mac-darwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32620