[Bug fortran/97920] [FINAL] -O2 segment fault due to extend derive type's member being partially allocated
tkoenig at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Dec 12 13:58:33 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97920
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|WAITING |RESOLVED
--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Paul is correct, the state of the pointers is undefined.
What you can do to correct this is to use
module m
type t1
real, dimension(:), pointer :: a => NULL()
contains
final :: t1f
end type
type, extends(t1) :: t2
real, dimension(:), pointer :: b => NULL()
contains
final :: t2f
end type
which will then run as expected.
More information about the Gcc-bugs
mailing list