This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/26017] New: allocate (a(1:-1)) should yield zero-sized array
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jan 2006 14:00:23 -0000
- Subject: [Bug fortran/26017] New: allocate (a(1:-1)) should yield zero-sized array
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat a3.f90
program main
integer, allocatable :: a(:)
allocate (a(1:-1))
end program main
$ gfortran a3.f90
$ ./a.out
Fortran runtime error: Attempt to allocate negative amount of memory. Possible
integer overflow
$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../../gcc/trunk/configure --prefix=/home/ig25
--enable-languages=c,fortran
Thread model: posix
gcc version 4.2.0 20060119 (experimental)
According to 6.3.1, this program should yield a zero-sized array.
Related to PR 25031 and PR 15335.
--
Summary: allocate (a(1:-1)) should yield zero-sized array
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkoenig at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26017