This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44154] New: initialization problem with allocatable scalars
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 May 2010 20:18:22 -0000
- Subject: [Bug fortran/44154] New: initialization problem with allocatable scalars
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Reported by Steve Kargl:
FAIL: gfortran.dg/class_19.f03 -O0 execution test
Reduced/modified test case:
implicit none
type foo
integer, allocatable :: int(:)
end type
type(foo),allocatable :: try
allocate(try)
end
This gives (with 4.5 and trunk):
Fortran runtime error: Attempting to allocate already allocated variable 'try'
The runtime error goes away when removing the allocatable component of 'foo' or
making it non-allocatable.
With the allocatable component, the dump is missing a line like:
try = 0B;
i.e. the allocatable scalar is not set to zero in the beginning. If 'foo' is an
allocatable array, everything is fine.
--
Summary: initialization problem with allocatable scalars
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: janus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44154