[Bug fortran/41872] wrong-code: Issues with allocatable scalars
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Nov 1 20:47:00 GMT 2009
------- Comment #5 from burnus at gcc dot gnu dot org 2009-11-01 20:46 -------
SAVE problem: Simply adding (!sym->attr.save && (... || ...)) to
gfc_trans_deferred_vars does not work as one then reaches "unreachable()"; one
should check where SAVE is handles for allocatable arrays, which is presumably
before gfc_trans_deferred_vars is called.
* * *
Need to add a test for:
integer, allocatable :: a
allocate(a)
deallocate(a)
deallocate(a) ! ERROR
end
(This works already.)
And a test for
integer, allocatable :: a
allocate(a)
allocate(a) ! ERROR
end
which doesn't work. (If it were, the following would not happen.)
There is no default initialization to NULL; thus the following crashes:
integer, allocatable :: a
if (allocated(a)) call abort()
end
* * *
One needs to also add tests for TYPE (incl. default initializer), for CLASS,
and for TYPE/CLASS with allocatable components. (SAVE, optional, intent(out),
allocate/deallocate statements, automatic deallocation...)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41872
More information about the Gcc-bugs
mailing list