[Bug fortran/97920] [FINAL] -O2 segment fault due to extend derive type's member being partially allocated
xin.liu@compiler-dev.com
gcc-bugzilla@gcc.gnu.org
Wed Dec 16 00:27:54 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97920
--- Comment #4 from xin liu <xin.liu@compiler-dev.com> ---
(In reply to Thomas Koenig from comment #3)
> 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.
OK,Thanks!
More information about the Gcc-bugs
mailing list