public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32827]  New: IMPORT fails for TYPE when also used in INTERFACE
@ 2007-07-19 23:04 sysmaint at contek dot com
  2007-07-20 16:22 ` [Bug fortran/32827] " tkoenig at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sysmaint at contek dot com @ 2007-07-19 23:04 UTC (permalink / raw)
  To: gcc-bugs

I created a program to invoke POSIX's gettimeofday using BIND(C) and
encountered
a compile-time problem.  In searching the bug database, I discovered 30922,
which exhibited a similar problem (now fixed).  I managed to recreate my
problem in a variant of the test program for 30922, so I am submitting
that program instead in the hope that it is simpler and may be more familiar.

The basic problem arises if I take the 30922 test program, convert it from
a module to a program and then add a declaration for a TYPE'd variable.
I have further simplified the test program, but I have also left the
original 30922 test program in comments.

The test program is:

! Original test program is from bug 30922.
! module test_import
program test_import
  implicit none

  type :: my_type
     integer :: data
  end type my_type

  interface
!     integer function func1(param)
     subroutine func1(param)
       import :: my_type
       type(my_type) :: param
!     end function func1
     end subroutine func1

!      integer function func2(param)
!        import :: my_type
!        type(my_type), value :: param
!      end function func2
  end interface
! end module test_import
  type(my_type) :: x           ! this declaration causes the problem
end program test_import

The error message is:
test_import.f:25.20:

  type(my_type) :: x           ! this declaration causes the problem
                   1
test_import.f:7.17:

  type :: my_type
                2
Error: The type my_type cannot be host associated at (1) because it is blocked
by an incompatible object of the same name at (2)

I believe that it is legal Fortran 2003 to incorporate INTERFACE declarations
immediately within a program, but I could be mistaken.


-- 
           Summary: IMPORT fails for TYPE when also used in INTERFACE
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sysmaint at contek dot com
 GCC build triplet: same - but with bug fix for fortran/32801 included
  GCC host triplet: i386-portbld-freebsd6.2 --  4.3.0 20070713
                    (experimental)
GCC target triplet: same


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


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

* [Bug fortran/32827] IMPORT fails for TYPE when also used in INTERFACE
  2007-07-19 23:04 [Bug fortran/32827] New: IMPORT fails for TYPE when also used in INTERFACE sysmaint at contek dot com
@ 2007-07-20 16:22 ` tkoenig at gcc dot gnu dot org
  2007-08-08 17:22 ` fxcoudert at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-07-20 16:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tkoenig at gcc dot gnu dot org  2007-07-20 16:22 -------
Not architecture specific.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|same - but with bug fix for |
                   |fortran/32801 included      |
   GCC host triplet|i386-portbld-freebsd6.2 --  |
                   |4.3.0 20070713              |
                   |(experimental)              |
 GCC target triplet|same                        |


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


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

* [Bug fortran/32827] IMPORT fails for TYPE when also used in INTERFACE
  2007-07-19 23:04 [Bug fortran/32827] New: IMPORT fails for TYPE when also used in INTERFACE sysmaint at contek dot com
  2007-07-20 16:22 ` [Bug fortran/32827] " tkoenig at gcc dot gnu dot org
@ 2007-08-08 17:22 ` fxcoudert at gcc dot gnu dot org
  2007-08-12 11:50 ` patchapp at dberlin dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-08-08 17:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2007-08-08 17:22 -------
I think it is indeed valid.

  type :: my_type
    integer :: data
  end type my_type

  interface
    subroutine func1(param)
      import :: my_type
      type(my_type) :: param
    end subroutine func1
  end interface

  type(my_type) :: x
end


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2007-08-08 17:22:43
               date|                            |


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


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

* [Bug fortran/32827] IMPORT fails for TYPE when also used in INTERFACE
  2007-07-19 23:04 [Bug fortran/32827] New: IMPORT fails for TYPE when also used in INTERFACE sysmaint at contek dot com
  2007-07-20 16:22 ` [Bug fortran/32827] " tkoenig at gcc dot gnu dot org
  2007-08-08 17:22 ` fxcoudert at gcc dot gnu dot org
@ 2007-08-12 11:50 ` patchapp at dberlin dot org
  2007-08-13 20:58 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: patchapp at dberlin dot org @ 2007-08-12 11:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from patchapp at dberlin dot org  2007-08-12 11:50 -------
Subject: Bug number PR32827

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00775.html


-- 


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


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

* [Bug fortran/32827] IMPORT fails for TYPE when also used in INTERFACE
  2007-07-19 23:04 [Bug fortran/32827] New: IMPORT fails for TYPE when also used in INTERFACE sysmaint at contek dot com
                   ` (2 preceding siblings ...)
  2007-08-12 11:50 ` patchapp at dberlin dot org
@ 2007-08-13 20:58 ` pault at gcc dot gnu dot org
  2007-08-13 21:05 ` pault at gcc dot gnu dot org
  2007-08-13 21:09 ` burnus at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-08-13 20:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2007-08-13 20:58 -------
Subject: Bug 32827

Author: pault
Date: Mon Aug 13 20:58:00 2007
New Revision: 127397

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127397
Log:
2007-08-13  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/32827
        * decl.c (variable_decl): Check for an imported symbol
        by looking for its symtree and testing for the imported
        attribute.
        (gfc_match_import): Remove change of symbol's namespace
        and set the attribute imported instead.
        * symbol.c (gfc_get_sym_tree): It is not an error if a
        symbol is imported.
        * gfortran.h : Add the 'imported' to symbol_attribute.

2007-08-13  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/32827
        * gfortran.dg/import6.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/import6.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/symbol.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/32827] IMPORT fails for TYPE when also used in INTERFACE
  2007-07-19 23:04 [Bug fortran/32827] New: IMPORT fails for TYPE when also used in INTERFACE sysmaint at contek dot com
                   ` (3 preceding siblings ...)
  2007-08-13 20:58 ` pault at gcc dot gnu dot org
@ 2007-08-13 21:05 ` pault at gcc dot gnu dot org
  2007-08-13 21:09 ` burnus at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-08-13 21:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2007-08-13 21:04 -------
Fixed on trunk

Paul


-- 


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


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

* [Bug fortran/32827] IMPORT fails for TYPE when also used in INTERFACE
  2007-07-19 23:04 [Bug fortran/32827] New: IMPORT fails for TYPE when also used in INTERFACE sysmaint at contek dot com
                   ` (4 preceding siblings ...)
  2007-08-13 21:05 ` pault at gcc dot gnu dot org
@ 2007-08-13 21:09 ` burnus at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-08-13 21:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from burnus at gcc dot gnu dot org  2007-08-13 21:08 -------
Mark really as fixed.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2007-08-13 21:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-19 23:04 [Bug fortran/32827] New: IMPORT fails for TYPE when also used in INTERFACE sysmaint at contek dot com
2007-07-20 16:22 ` [Bug fortran/32827] " tkoenig at gcc dot gnu dot org
2007-08-08 17:22 ` fxcoudert at gcc dot gnu dot org
2007-08-12 11:50 ` patchapp at dberlin dot org
2007-08-13 20:58 ` pault at gcc dot gnu dot org
2007-08-13 21:05 ` pault at gcc dot gnu dot org
2007-08-13 21:09 ` burnus 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).