From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8AC923858439; Thu, 9 Mar 2023 15:33:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AC923858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678376017; bh=zV8loMa2SWgipzRDPTrvrrrkBnBYjv5Q0f9mvV9FNzk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PIiTSkQ1IhJ8QZmFQE+ywEY/ZspTRibKPbykwTDK76fwMjD+is2gFJUDrXnf7eBe9 zd2bUuluE8spPDsZFEsGoXomgZOMJL1HBYX6aLnTFBXncbMNRMJ7vaP9BZ0b94f0ry DE2u/ST2rhSPco9q9aJ/EF+w8uHaL+YkbBuXhEiI= From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109066] Segfault when using defined assignment Date: Thu, 09 Mar 2023 15:33:37 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109066 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #3 from kargl at gcc dot gnu.org --- (In reply to Paul Thomas from comment #2) > Hi Andrew, >=20 > Thanks for the report. However, IMHO the code is invalid since the result= of > hdf5Constructor is not defined. >=20 > function hdf5Constructor() result(self) > implicit none > type(hdf5Object) :: self > self =3D hdf5Object (resourceManager()) > return > end function hdf5Constructor >=20 > works a treat. >=20 > If there is a requirement in the standard that a function result such as > this be initialised, I am unable to find it in the F2018 standard.=20 >=20 > Paul F2018, page 319. If the function result is not a pointer, its value shall be defined by the function. If the function result is a pointer, on return the pointer association status of the function result shall not be undefined.=