public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/37253]  New: Segmentation fault with procedure pointer
@ 2008-08-27 10:51 dominiq at lps dot ens dot fr
  2008-08-27 12:37 ` [Bug fortran/37253] " janus at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-08-27 10:51 UTC (permalink / raw)
  To: gcc-bugs

The following code

module myMod

  CONTAINS

  real function proc3( arg1 )
     integer :: arg1
     proc3 = arg1+7
  end function proc3

  subroutine proc4( arg1 )
     procedure(real), pointer :: arg1
     print*, 'the func: ', arg1(0)
  end subroutine proc4

end module myMod

program myProg
  use myMod
  PROCEDURE (real), POINTER :: p => NULL()
  p => proc3
  print*, 'the func: ', p(0)
  call proc4( p )
end program myProg

gives a segmentation fault at run time:

[ibook-dhum] f90/bug% a.out 
 the func:    7.0000000    
Segmentation fault


-- 
           Summary: Segmentation fault with procedure pointer
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominiq at lps dot ens dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37253


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-08-28 15:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-27 10:51 [Bug fortran/37253] New: Segmentation fault with procedure pointer dominiq at lps dot ens dot fr
2008-08-27 12:37 ` [Bug fortran/37253] " janus at gcc dot gnu dot org
2008-08-27 20:31 ` burnus at gcc dot gnu dot org
2008-08-27 20:34 ` burnus at gcc dot gnu dot org
2008-08-27 21:12 ` janus at gcc dot gnu dot org
2008-08-28 11:25 ` janus at gcc dot gnu dot org
2008-08-28 15:13 ` janus at gcc dot gnu dot org
2008-08-28 15:14 ` janus at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).