This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29344] New: [gfortran,4.2.0 regression] valid ALLOCATE-statement rejected

Current mainline gfortran rejects the following code:

program test
type foo
  integer size
  real,pointer,dimension(:) :: vals
end type

type(foo) var1
end program

~/tmp>gfortran -v test.f90
Driving: gfortran -v test.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /scratch/gcc/configure --prefix=/afs/mpa/data/martin/ugcc
--enable-languages=c++,fortran --with-gmp=/afs/mpa/data/martin/mygmp
--with-mpfr=/afs/mpa/data/martin/mympfr --without-makeinfo --disable-tls
Thread model: posix
gcc version 4.2.0 20061004 (experimental)
 /afs/mpa/data/martin/ugcc/libexec/gcc/i686-pc-linux-gnu/4.2.0/f951 test.f90
-quiet -dumpbase test.f90 -mtune=generic -auxbase test -version -I
/afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.2.0/finclude -o
GNU F95 version 4.2.0 20061004 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.2.0 20061004 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
 In file test.f90:9

Error: 'var1' must not appear an the array specification at (1) in the same
ALLOCATE statement where it is itself allocated

The code is accepted by current gfortran 4.1 and by 4.2 a few days ago.
AFAICT it is valid Fortran.

           Summary: [gfortran,4.2.0 regression] valid ALLOCATE-statement
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: martin at mpa-garching dot mpg dot de
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]