public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51055] New: deferred length character allocation: allocate(character(len=i)::s) rejected
@ 2011-11-09 12:09 jpr at csc dot fi
  2011-11-09 13:18 ` [Bug fortran/51055] " burnus at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jpr at csc dot fi @ 2011-11-09 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51055
           Summary: deferred length character allocation:
                    allocate(character(len=i)::s) rejected
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jpr@csc.fi


Hi,

I think the program below is valid, but rejected by gfortran 


program a
  character(len=:), allocatable :: s
  integer :: i=10
  allocate(character(len=i)::s)
end program a


gfortran -v -o s s.f90
Driving: gfortran -v -o s s.f90 -l gfortran -l m -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/wrk/jpr/gcc-4.7/bin/../libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --enable-languages=c,c++,fortran
--disable-bootstrap --prefix=/wrk/jpr/gcc-4.7 --with-gmp=/wrk/jpr/extralib
--with-mpfr=/wrk/jpr/extralib
Thread model: posix
gcc version 4.7.0 20110927 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 's' '-shared-libgcc' '-mtune=generic'
'-march=pentiumpro'
 /home/wrk/jpr/gcc-4.7/bin/../libexec/gcc/i686-pc-linux-gnu/4.7.0/f951 s.f90
-quiet -dumpbase s.f90 -mtune=generic -march=pentiumpro -auxbase s -version
-fintrinsic-modules-path
/home/wrk/jpr/gcc-4.7/bin/../lib/gcc/i686-pc-linux-gnu/4.7.0/finclude -o
/tmp/cc1PUv7g.s
GNU Fortran (GCC) version 4.7.0 20110927 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 3.4.6 20060404 (Red Hat 3.4.6-11), GMP
version 4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Fortran (GCC) version 4.7.0 20110927 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 3.4.6 20060404 (Red Hat 3.4.6-11), GMP
version 4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
s.f90:4.25:

  allocate(character(len=i)::s)
                         1
Error: Variable 'i' cannot appear in the expression at (1)


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

end of thread, other threads:[~2012-05-23 20:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-09 12:09 [Bug fortran/51055] New: deferred length character allocation: allocate(character(len=i)::s) rejected jpr at csc dot fi
2011-11-09 13:18 ` [Bug fortran/51055] " burnus at gcc dot gnu.org
2011-11-10  8:14 ` jpr at csc dot fi
2011-11-10  8:38 ` burnus at gcc dot gnu.org
2012-05-11 14:39 ` burnus at gcc dot gnu.org
2012-05-14 16:47 ` burnus at gcc dot gnu.org
2012-05-14 16:56 ` burnus at gcc dot gnu.org
2012-05-23 20:36 ` burnus at gcc dot gnu.org
2012-05-23 20:46 ` burnus at gcc dot gnu.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).