From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4E15F3858439; Thu, 30 Mar 2023 18:59:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E15F3858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680202790; bh=LNhdDWFQxipsiGkgwTr6aAHw4t//5jHFIkerEwZmbmw=; h=From:To:Subject:Date:From; b=GvqJOkAesZl4SLoISHUGk1ZyZx+oqniQvqJQTFo3aRMQbtNGkClJCzC3jFXk8qcT7 pMCnTxvdiOe9CEBGChngrbeGf4G1sR7Ecnif1TKZBTMt9sJvUeqlX9pE6tJoFVv2AY NixFzta/JJQTr6HrM4zwTerA2X9b0MAhHWD00ZyQ= From: "pault at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109348] New: Pointer initialization fails for target with references Date: Thu, 30 Mar 2023 18:59:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: pault at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D109348 Bug ID: 109348 Summary: Pointer initialization fails for target with references Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: pault at gcc dot gnu.org Target Milestone: --- As posted by Peter Klausler on clf complex, save, target :: a(4) =3D [(1.,0.),(2.,0.),(3.,0.),(4.,0)] real, pointer :: p(:) =3D> a(1:3:2)%re print *, p end gfc doesn't even attempt to initialise the pointer. Malcolm Cohen and Steve Lionel both agree that this is valid F2018. complex, save, target :: a(4) =3D [(1.,0.),(2.,0.),(3.,0.),(4.,0)] real, pointer :: p(:) p(1:) =3D> a(1:3:2)%re print *, p end Works, as long as an lbound is provided on the lhs. nagfor behaves similarl= y, whereas ifort does not even accept this version.=20 Cheers Paul=