------- Comment #3 from burnus at gcc dot gnu dot org  2009-11-01 16:08 -------
First patch: http://gcc.gnu.org/ml/fortran/2009-11/msg00001.html

TODO:

* For ALLOCATABLE, OPTIONAL" dummies: If the argument is present but not
allocated, "PRESENT()" returns false. As test case add the lines
  deallocate(b)
  call checkOptional(.true., .false., 7482, b)
at the end of the main program of allocatable_scalar_4.f90 (cf. patch).

* Explicit Allocate/Deallocate calls do not fail if the variable is already
(de)allocated.

To check:
> - Default init with NULL pointer
> - Allocatable DT with allocatable components (init when allocating; auto
> dealloc when going out of scope and for intent(out))

The following program fails:

subroutine test()
  integer, allocatable, save :: a
  if(.not. allocated(a)) then
    allocate(a)
    a = 42
  else
    if (.not. allocated(a)) call abort()
    if (a /= 42) call abort()
  end if
end subroutine test

call test()
call test()
end


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|wrong-code: No auto-        |wrong-code: Issues with
                   |deallocation for INTENT(OUT)|allocatable scalars
                   |allocatable scalars         |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41872

Reply via email to