This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47024] [OOP] STORAGE_SIZE (for polymorphic types): Segfault at run time
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 4 Jan 2011 13:49:29 +0000
- Subject: [Bug fortran/47024] [OOP] STORAGE_SIZE (for polymorphic types): Segfault at run time
- Auto-submitted: auto-generated
- References: <bug-47024-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47024
--- Comment #5 from janus at gcc dot gnu.org 2011-01-04 13:49:27 UTC ---
The dump for the test case in comment #0 currently looks like this [excerpt]:
y._data = 0B;
{
[...]
_gfortran_st_write (&dt_parm.0);
{
integer(kind=4) D.1548;
D.1548 = (y._vptr->_size * 8) / 8;
_gfortran_transfer_integer_write (&dt_parm.0, &D.1548, 4);
}
_gfortran_st_write_done (&dt_parm.0);
}
Since "y._vptr" is initially undefined, we get an ICE. The solution would be to
initialize the _vptr component of all polymorphic allocatables to the declared
type.