diff options
author | Thomas Koenig <Thomas.Koenig@online.de> | 2006-03-30 16:30:26 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2006-03-30 16:30:26 +0000 |
commit | 6b86a9bc0536c073a70c7fdb563a36afe2dd6fbf (patch) | |
tree | ccefb2ba3589b346ff9e82de690b49f0e7f063c7 /gcc | |
parent | c7ec5472672f0e68687081caa28ffb196e9c37a1 (diff) | |
download | gcc-6b86a9bc0536c073a70c7fdb563a36afe2dd6fbf.zip gcc-6b86a9bc0536c073a70c7fdb563a36afe2dd6fbf.tar.gz gcc-6b86a9bc0536c073a70c7fdb563a36afe2dd6fbf.tar.bz2 |
re PR fortran/25031 ([4.1 only] Allocatable array can be reallocated.)
2006-03-30 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/25031
* runtime/memory.c (allocate_array): If stat is present and
the variable is already allocated, free the variable, do
the allocation and set stat.
(allocate_array_64): Likewise. Whitespace fix.
2006-03-30 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/25031
* gfortran.dg/multiple_allocation_1.f90: Check that the
size has changed after a re-allocation with stat.
From-SVN: r112539
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/multiple_allocation_1.f90 | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 53f2522..018e11c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-03-30 Thomas Koenig <Thomas.Koenig@online.de> + + PR fortran/25031 + * gfortran.dg/multiple_allocation_1.f90: Check that the + size has changed after a re-allocation with stat. + 2006-03-30 Richard Guenther <rguenther@suse.de> * gcc.target/i386/sselibm-1.c: Adjust for libgcc-math partial diff --git a/gcc/testsuite/gfortran.dg/multiple_allocation_1.f90 b/gcc/testsuite/gfortran.dg/multiple_allocation_1.f90 index 9c14248..2b91373 100644 --- a/gcc/testsuite/gfortran.dg/multiple_allocation_1.f90 +++ b/gcc/testsuite/gfortran.dg/multiple_allocation_1.f90 @@ -8,10 +8,11 @@ program alloc_test integer, pointer :: b(:) allocate(a(4)) - ! This should set the stat code without changing the size - allocate(a(4),stat=i) + ! This should set the stat code and change the size. + allocate(a(3),stat=i) if (i == 0) call abort if (.not. allocated(a)) call abort + if (size(a) /= 3) call abort ! It's OK to allocate pointers twice (even though this causes ! a memory leak) allocate(b(4)) |