From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23638 invoked by alias); 23 Dec 2010 18:04:52 -0000 Received: (qmail 23629 invoked by uid 22791); 23 Dec 2010 18:04:52 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Dec 2010 18:04:48 +0000 From: "deji_aking at yahoo dot ca" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47054] New: Compilation error when cray pointers are declared in both host and internal subroutines X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: deji_aking at yahoo dot ca X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 23 Dec 2010 18:04:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg02576.txt.bz2 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: unassigned@gcc.gnu.org ReportedBy: deji_aking@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 >>>>>