public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/20541] New: INTEGER type declaration: ALLOCATABLE, compilation error
@ 2005-03-18 20:43 madbosun at gmail dot com
  2005-03-18 22:09 ` [Bug fortran/20541] " kargl at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: madbosun at gmail dot com @ 2005-03-18 20:43 UTC (permalink / raw)
  To: gcc-bugs

This line is a allocatable integer type declaration in a standard module

"
gfortran -ffree-form -O3 -c dvr.f90
 In file dvr.f90:8

    INTEGER(kind=4), ALLOCATABLE :: glmark(:)
                               1
Error: Attribute at (1) is not allowed in a TYPE definition
make: *** [dvr.mod] Error 1
"

And so the compiler exits on the error

The partial source for the module.

MODULE DVR
  implicit none
!  PRIVATE
  PUBLIC :: buildgrid, writegrid, creategrid1, creategrid2, ecscreategrid1,
ecscreategrid2

  TYPE dvrgrid
    INTEGER(kind=4) :: gln, nfe, cess, nnodes, nreal, ncomplex, gnn, fim, lim
    INTEGER(kind=4), ALLOCATABLE :: glmark(:)
    REAL(kind=8) :: phi
    REAL(kind=8), pointer :: fenodes(:), gnodes(:), rnodes(:), wr(:)
    COMPLEX(kind=8), pointer :: znodes(:), wz(:)
  END TYPE dvrgrid

!  INTERFACE buildgrid
!    MODULE PROCEDURE creategrid1, creategrid2, ecscreategrid1, ecscreategrid2
  END INTERFACE

  INTERFACE D1node
    MODULE PROCEDURE D1glnode, D1gennode
  END INTERFACE

CONTAINS

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

END MODULE DVR

-- 
           Summary: INTEGER type declaration: ALLOCATABLE, compilation error
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: madbosun at gmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: Intel Opteron


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


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

* [Bug fortran/20541] INTEGER type declaration: ALLOCATABLE, compilation error
  2005-03-18 20:43 [Bug fortran/20541] New: INTEGER type declaration: ALLOCATABLE, compilation error madbosun at gmail dot com
@ 2005-03-18 22:09 ` kargl at gcc dot gnu dot org
  2005-03-20 18:08 ` [Bug fortran/20541] ALLOCATABLE components tobi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu dot org @ 2005-03-18 22:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kargl at gcc dot gnu dot org  2005-03-18 22:08 -------
Your code is illegal with respect to the Fortran 95 standard.  See section
4.4.1, page 38, of the (draft) standard, you'll find the following 

R426  component-attr-spec   is POINTER
                            or DIMENSION ( component-array-spec )

Note ALLOACTABLE is not listed above.

If you have Metcalf & Reid, Fortran 90/95 Explained, 2nd ed., you'll find on
page 107:

   If a variable-sized array component of a structure is required,
   unfortunately, an array pointer must be used (see Section 6.14).
   The prohibition on allocatable arrays here was made to keep the
   the feature simple, but this is now recognized as a mistake that
   will be corrected in Fortran 2000
  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


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


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

* [Bug fortran/20541] ALLOCATABLE components
  2005-03-18 20:43 [Bug fortran/20541] New: INTEGER type declaration: ALLOCATABLE, compilation error madbosun at gmail dot com
  2005-03-18 22:09 ` [Bug fortran/20541] " kargl at gcc dot gnu dot org
@ 2005-03-20 18:08 ` tobi at gcc dot gnu dot org
  2005-04-22 12:43 ` [Bug fortran/20541] TR 15581: " fxcoudert at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-03-20 18:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2005-03-20 18:08 -------
This only allowed after TR15581 which is unimplemented so far in gfortran.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2005-03-20 18:08:03
               date|                            |
            Summary|INTEGER type declaration:   |ALLOCATABLE components
                   |ALLOCATABLE, compilation    |
                   |error                       |


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


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

* [Bug fortran/20541] TR 15581: ALLOCATABLE components
  2005-03-18 20:43 [Bug fortran/20541] New: INTEGER type declaration: ALLOCATABLE, compilation error madbosun at gmail dot com
  2005-03-18 22:09 ` [Bug fortran/20541] " kargl at gcc dot gnu dot org
  2005-03-20 18:08 ` [Bug fortran/20541] ALLOCATABLE components tobi at gcc dot gnu dot org
@ 2005-04-22 12:43 ` fxcoudert at gcc dot gnu dot org
  2005-07-29  8:45 ` post at tillmann-wegst dot de
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-04-22 12:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-04-22 12:42 -------
This prevents compiling the common iso_varying_string module by Rich Townsend.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
   Last reconfirmed|2005-03-20 18:08:03         |2005-04-22 12:42:25
               date|                            |


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


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

* [Bug fortran/20541] TR 15581: ALLOCATABLE components
  2005-03-18 20:43 [Bug fortran/20541] New: INTEGER type declaration: ALLOCATABLE, compilation error madbosun at gmail dot com
                   ` (2 preceding siblings ...)
  2005-04-22 12:43 ` [Bug fortran/20541] TR 15581: " fxcoudert at gcc dot gnu dot org
@ 2005-07-29  8:45 ` post at tillmann-wegst dot de
  2005-09-27 15:21 ` erik dot edelmann at iki dot fi
  2005-09-29 19:48 ` erik dot edelmann at iki dot fi
  5 siblings, 0 replies; 7+ messages in thread
From: post at tillmann-wegst dot de @ 2005-07-29  8:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From post at tillmann-wegst dot de  2005-07-29 08:21 -------
I found that code containing allocatable fields in type statements compiles 
without complaints using "g95", so I was a bit perplex when moving to gfortran 
and getting the same error as reported here. 

Consulting Metcalf et al, "fortran 95/2003 explained", chap. 7.12, pages 149f., 
I did not find anything as to a conflict between attributes "allocatable" 
and "dimension". Has there been a change in the Fortran95 specs? 

If it is not a gfortran bug, what would be a work-around? Declare the variable 
as a pointer, allocate the array in a subroutine and then direct the pointer 
variable to it? That seems like a way out, though clumsy. 

-- 


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


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

* [Bug fortran/20541] TR 15581: ALLOCATABLE components
  2005-03-18 20:43 [Bug fortran/20541] New: INTEGER type declaration: ALLOCATABLE, compilation error madbosun at gmail dot com
                   ` (3 preceding siblings ...)
  2005-07-29  8:45 ` post at tillmann-wegst dot de
@ 2005-09-27 15:21 ` erik dot edelmann at iki dot fi
  2005-09-29 19:48 ` erik dot edelmann at iki dot fi
  5 siblings, 0 replies; 7+ messages in thread
From: erik dot edelmann at iki dot fi @ 2005-09-27 15:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From erik dot edelmann at iki dot fi  2005-09-27 15:21 -------
Working on a patch.

-- 


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


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

* [Bug fortran/20541] TR 15581: ALLOCATABLE components
  2005-03-18 20:43 [Bug fortran/20541] New: INTEGER type declaration: ALLOCATABLE, compilation error madbosun at gmail dot com
                   ` (4 preceding siblings ...)
  2005-09-27 15:21 ` erik dot edelmann at iki dot fi
@ 2005-09-29 19:48 ` erik dot edelmann at iki dot fi
  5 siblings, 0 replies; 7+ messages in thread
From: erik dot edelmann at iki dot fi @ 2005-09-29 19:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From erik dot edelmann at iki dot fi  2005-09-29 19:48 -------
(In reply to comment #5)
> Working on a patch.

Turned out to be much more work than I first thought.  I'll leave it for now.

-- 


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


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

end of thread, other threads:[~2005-09-29 19:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-18 20:43 [Bug fortran/20541] New: INTEGER type declaration: ALLOCATABLE, compilation error madbosun at gmail dot com
2005-03-18 22:09 ` [Bug fortran/20541] " kargl at gcc dot gnu dot org
2005-03-20 18:08 ` [Bug fortran/20541] ALLOCATABLE components tobi at gcc dot gnu dot org
2005-04-22 12:43 ` [Bug fortran/20541] TR 15581: " fxcoudert at gcc dot gnu dot org
2005-07-29  8:45 ` post at tillmann-wegst dot de
2005-09-27 15:21 ` erik dot edelmann at iki dot fi
2005-09-29 19:48 ` erik dot edelmann at iki dot fi

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