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

           Summary: Compilation error when cray pointers are declared in
                    both host and internal subroutines
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: deji_ak...@yahoo.ca


The following code produces compilation error when compiled with gfortran-4.5.1
(gcc version 4.5.1 20101130 (Red Hat 4.5.1-6) (GCC)). It compiles fine if I
remove the 'contains' statement, and replace it with 'end subroutine host_sub'.

>>>>>
subroutine host_sub(F_su,F_nk)
   implicit none

   integer :: F_nk
   real,dimension(F_nk) :: F_su
      integer G_ni, G_nj
      real*8 G_xg_8, G_yg_8
      pointer (paxg_8, G_xg_8(G_ni))
      pointer (payg_8, G_yg_8(G_nj))
      common / G_p / paxg_8,payg_8
!
      common / G / G_ni, G_nj

   call internal_sub(F_su,F_nk)
   return
contains 

   subroutine internal_sub(F_su,F_nk)
      implicit none
!
      integer G_ni, G_nj
      real*8 G_xg_8, G_yg_8
      pointer (paxg_8, G_xg_8(G_ni))
      pointer (payg_8, G_yg_8(G_nj))
      common / G_p / paxg_8,payg_8
!
      common / G / G_ni, G_nj

      integer :: F_nk
      real,dimension(F_nk) :: F_su 
      integer k,k2

      k2 = 0
      do k = 1, F_nk, 2
         k2 = k2+1
               F_su(k) = F_su(k) + 1.0
      enddo
      return
   end subroutine internal_sub
end subroutine host_sub
>>>>>

Reply via email to