Ooops... error in my ChangeLog: "fix" -> "free"
2011-07-22 Daniel Carrera <dcarr...@gmail.com> * trans.c (gfc__allocate_allocatable): [PR 4755] Do not free and the reallocate a variable that is already allocated. On 07/22/2011 08:54 PM, Daniel Carrera wrote:
Hello, This is a simple patch that fixes PR 4755. Currently the ALLOCATE statement will free and re-allocate an already allocated scalar. The Fortran standard says that this is an error. The attached patch fixes the problem. I am also attaching two tree dumps of the same program, compiled before and after the application of this patch. The test program is this: program test integer, allocatable :: A(:), B[:] integer :: stat character(len=33) :: str allocate(A(1), B[*], stat=stat) end program If you compare the "before" and "after" files you'll see that with this patch GCC no longer tries to free and reallocate A(1). You will also notice that the block for B[*] didn't change. The block for B[*] is already correct in trunk and doesn't need changing. Here is my ChangeLog: 2011-07-22 Daniel Carrera <dcarr...@gmail.com> * trans.c (gfc__allocate_allocatable): [PR 4755] Do not fix and the reallocate a variable that is already allocated.
-- I'm not overweight, I'm undertall.