public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47054] New: Compilation error when cray pointers are declared in both host and internal subroutines
@ 2010-12-23 18:04 deji_aking at yahoo dot ca
  2010-12-23 19:23 ` [Bug fortran/47054] " kargl at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: deji_aking at yahoo dot ca @ 2010-12-23 18:04 UTC (permalink / raw)
  To: gcc-bugs

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
>>>>>


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

* [Bug fortran/47054] Compilation error when cray pointers are declared in both host and internal subroutines
  2010-12-23 18:04 [Bug fortran/47054] New: Compilation error when cray pointers are declared in both host and internal subroutines deji_aking at yahoo dot ca
@ 2010-12-23 19:23 ` kargl at gcc dot gnu.org
  2010-12-23 19:33 ` dominiq at lps dot ens.fr
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: kargl at gcc dot gnu.org @ 2010-12-23 19:23 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org 2010-12-23 19:23:14 UTC ---
What compilation error?


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

* [Bug fortran/47054] Compilation error when cray pointers are declared in both host and internal subroutines
  2010-12-23 18:04 [Bug fortran/47054] New: Compilation error when cray pointers are declared in both host and internal subroutines deji_aking at yahoo dot ca
  2010-12-23 19:23 ` [Bug fortran/47054] " kargl at gcc dot gnu.org
@ 2010-12-23 19:33 ` dominiq at lps dot ens.fr
  2011-01-03 15:51 ` deji_aking at yahoo dot ca
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2010-12-23 19:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2010-12-23 19:33:04 UTC ---
> What compilation error?

For me it is

[macbook] f90/bug% gfc -fcray-pointer pr47054.f90
pr47054.f90:23.29:

      pointer (paxg_8, G_xg_8(G_ni))
                             1
Error: Symbol 'g_xg_8' at (1) has no IMPLICIT type
pr47054.f90:24.29:

      pointer (payg_8, G_yg_8(G_nj))
                             1
Error: Symbol 'g_yg_8' at (1) has no IMPLICIT type


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

* [Bug fortran/47054] Compilation error when cray pointers are declared in both host and internal subroutines
  2010-12-23 18:04 [Bug fortran/47054] New: Compilation error when cray pointers are declared in both host and internal subroutines deji_aking at yahoo dot ca
  2010-12-23 19:23 ` [Bug fortran/47054] " kargl at gcc dot gnu.org
  2010-12-23 19:33 ` dominiq at lps dot ens.fr
@ 2011-01-03 15:51 ` deji_aking at yahoo dot ca
  2011-01-03 22:39 ` kargl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: deji_aking at yahoo dot ca @ 2011-01-03 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

Deji Akingunola <deji_aking at yahoo dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |4.5.1

--- Comment #3 from Deji Akingunola <deji_aking at yahoo dot ca> 2011-01-03 15:50:58 UTC ---
(In reply to comment #1)
> What compilation error?

Sorry I missed stating the actual error earlier. It is the same as in comment
#2 above.


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

* [Bug fortran/47054] Compilation error when cray pointers are declared in both host and internal subroutines
  2010-12-23 18:04 [Bug fortran/47054] New: Compilation error when cray pointers are declared in both host and internal subroutines deji_aking at yahoo dot ca
                   ` (2 preceding siblings ...)
  2011-01-03 15:51 ` deji_aking at yahoo dot ca
@ 2011-01-03 22:39 ` kargl at gcc dot gnu.org
  2011-01-03 22:42 ` kargl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-01-03 22:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from kargl at gcc dot gnu.org 2011-01-03 22:39:37 UTC ---
Reduced testcase.

subroutine host_sub
   implicit none
   real xg
   pointer (paxg, xg)
   call internal_sub
   contains 
      subroutine internal_sub
         implicit none
         real xg
         pointer (paxg, xg)
      end subroutine internal_sub
end subroutine host_sub


It seems that gfortran is getting confused
by host association, the symbol names, and
the pointer() in internal_sub.


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

* [Bug fortran/47054] Compilation error when cray pointers are declared in both host and internal subroutines
  2010-12-23 18:04 [Bug fortran/47054] New: Compilation error when cray pointers are declared in both host and internal subroutines deji_aking at yahoo dot ca
                   ` (3 preceding siblings ...)
  2011-01-03 22:39 ` kargl at gcc dot gnu.org
@ 2011-01-03 22:42 ` kargl at gcc dot gnu.org
  2011-01-03 23:59 ` kargl at gcc dot gnu.org
  2014-05-13 14:22 ` dominiq at lps dot ens.fr
  6 siblings, 0 replies; 8+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-01-03 22:42 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
      Known to fail|                            |4.2.5, 4.3.6, 4.4.6, 4.5.1,
                   |                            |4.6.0


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

* [Bug fortran/47054] Compilation error when cray pointers are declared in both host and internal subroutines
  2010-12-23 18:04 [Bug fortran/47054] New: Compilation error when cray pointers are declared in both host and internal subroutines deji_aking at yahoo dot ca
                   ` (4 preceding siblings ...)
  2011-01-03 22:42 ` kargl at gcc dot gnu.org
@ 2011-01-03 23:59 ` kargl at gcc dot gnu.org
  2014-05-13 14:22 ` dominiq at lps dot ens.fr
  6 siblings, 0 replies; 8+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-01-03 23:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from kargl at gcc dot gnu.org 2011-01-03 23:58:41 UTC ---
The problem appears to be in decl.c(variable_decl)

  /*  If this symbol has already shown up in a Cray Pointer declaration,
      then we want to set the type & bail out.  */
  if (gfc_option.flag_cray_pointer)
    {
      gfc_find_symbol (name, gfc_current_ns, 1, &sym);
      if (sym != NULL && sym->attr.cray_pointee)
    {
      sym->ts.type = current_ts.type;
      sym->ts.kind = current_ts.kind;

When gfc_find_symbol() returns, sym == NULL, so the
if block is skipped.  current_ts.type is BT_REAL and
for the reduced testcase current_ts.kind = 4, which 
is want we want.  I think we may want to have a

if (sym == NULL &&  sym->attr.cray_pointee)
   insert_name_into_current_namespace.

Unfortnately, I can't remember how to do that
and have no time to investigate further.


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

* [Bug fortran/47054] Compilation error when cray pointers are declared in both host and internal subroutines
  2010-12-23 18:04 [Bug fortran/47054] New: Compilation error when cray pointers are declared in both host and internal subroutines deji_aking at yahoo dot ca
                   ` (5 preceding siblings ...)
  2011-01-03 23:59 ` kargl at gcc dot gnu.org
@ 2014-05-13 14:22 ` dominiq at lps dot ens.fr
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-05-13 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-05-13
     Ever confirmed|0                           |1

--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still failing at r210330 (4.10.0).


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

end of thread, other threads:[~2014-05-13 14:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-23 18:04 [Bug fortran/47054] New: Compilation error when cray pointers are declared in both host and internal subroutines deji_aking at yahoo dot ca
2010-12-23 19:23 ` [Bug fortran/47054] " kargl at gcc dot gnu.org
2010-12-23 19:33 ` dominiq at lps dot ens.fr
2011-01-03 15:51 ` deji_aking at yahoo dot ca
2011-01-03 22:39 ` kargl at gcc dot gnu.org
2011-01-03 22:42 ` kargl at gcc dot gnu.org
2011-01-03 23:59 ` kargl at gcc dot gnu.org
2014-05-13 14:22 ` dominiq at lps dot ens.fr

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).