This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41872] wrong-code: Issues with allocatable scalars
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Nov 2009 16:08:10 -0000
- Subject: [Bug fortran/41872] wrong-code: Issues with allocatable scalars
- References: <bug-41872-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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