This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/37253] New: Segmentation fault with procedure pointer


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]