From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E17E3385780F; Wed, 16 Dec 2020 00:27:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E17E3385780F From: "xin.liu@compiler-dev.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/97920] [FINAL] -O2 segment fault due to extend derive type's member being partially allocated Date: Wed, 16 Dec 2020 00:27:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xin.liu@compiler-dev.com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2020 00:27:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97920 --- Comment #4 from xin liu --- (In reply to Thomas Koenig from comment #3) > Paul is correct, the state of the pointers is undefined. >=20 > What you can do to correct this is to use >=20 > module m > type t1 > real, dimension(:), pointer :: a =3D> NULL() > contains > final :: t1f > end type >=20 > type, extends(t1) :: t2 > real, dimension(:), pointer :: b =3D> NULL() > contains > final :: t2f > end type >=20 > which will then run as expected. OK,Thanks!=