[Bug fortran/25031] Allocatable array can be reallocated.
--- Comment #2 from tkoenig at gcc dot gnu dot org 2006-01-28 18:49 --- This one is a bit tricky, because the code would be legal (if memory-leaking) for if a were a pointer. Also, using a stat variable is supposed to catch this. Seems like we need a new function for allocating allocatable arrays, which checks for allocation status and errors out if the array is already allocated. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25031
[Bug fortran/25031] Allocatable array can be reallocated.
--- Comment #3 from tkoenig at gcc dot gnu dot org 2006-03-03 16:18 --- Subject: Bug 25031 Author: tkoenig Date: Fri Mar 3 16:18:46 2006 New Revision: 111677 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111677 Log: 2006-03-03 Thomas Koenig <[EMAIL PROTECTED]> PR fortran/25031 * trans-array.h: Adjust gfc_array_allocate prototype. * trans-array.c (gfc_array_allocate): Change type of gfc_array_allocatate to bool. Function returns true if it operates on an array. Change second argument to gfc_expr. Find last reference in chain. If the function operates on an allocatable array, emit call to allocate_array() or allocate64_array(). * trans-stmt.c (gfc_trans_allocate): Code to follow to last reference has been moved to gfc_array_allocate. * trans.h: Add declaration for gfor_fndecl_allocate_array and gfor_fndecl_allocate64_array. (gfc_build_builtin_function_decls): Add gfor_fndecl_allocate_array and gfor_fndecl_allocate64_array. 2006-03-03 Thomas Koenig <[EMAIL PROTECTED]> PR fortran/25031 * runtime/memory.c: Adjust copyright years. (allocate_array): New function. (allocate64_array): New function. * libgfortran.h (error_codes): Add ERROR_ALLOCATION. 2006-03-03 Thomas Koenig <[EMAIL PROTECTED]> PR fortran/25031 * multiple_allocation_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/multiple_allocation_1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-array.c trunk/gcc/fortran/trans-array.h trunk/gcc/fortran/trans-decl.c trunk/gcc/fortran/trans-stmt.c trunk/gcc/fortran/trans.h trunk/gcc/testsuite/ChangeLog trunk/libgfortran/ChangeLog trunk/libgfortran/libgfortran.h trunk/libgfortran/runtime/memory.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25031
[Bug fortran/25031] Allocatable array can be reallocated.
--- Comment #4 from tkoenig at gcc dot gnu dot org 2006-03-23 18:36 --- There is a problem with the current solution on trunk. When we do allocate (a(10)) allocate (a(20),stat=i) the size information is changed, but the size of the array is not. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25031
[Bug fortran/25031] Allocatable array can be reallocated.
--- Comment #5 from tkoenig at gcc dot gnu dot org 2006-03-30 16:30 --- Subject: Bug 25031 Author: tkoenig Date: Thu Mar 30 16:30:26 2006 New Revision: 112539 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112539 Log: 2006-03-30 Thomas Koenig <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> PR fortran/25031 * gfortran.dg/multiple_allocation_1.f90: Check that the size has changed after a re-allocation with stat. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/multiple_allocation_1.f90 trunk/libgfortran/ChangeLog trunk/libgfortran/runtime/memory.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25031
[Bug fortran/25031] Allocatable array can be reallocated.
--- Comment #1 from eedelman at gcc dot gnu dot org 2005-11-25 15:09 --- Confirmed. -- eedelman at gcc dot gnu dot org changed: What|Removed |Added CC||eedelman at gcc dot gnu dot ||org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2005-11-25 15:09:21 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25031