From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EB72A3858C53; Sun, 25 Sep 2022 20:32:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB72A3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664137925; bh=FJUSleSIf2EFpXS33kR/GMLVcqHlMxzosbTPBrmNOIw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NnVcpOGUS5y1CJWrAgfwEeZ9QE1z7wasoc5/1sUbcNKjTCOf/AKW8OtFtqXwc/J4I nFhnj97VC5ApS23d2MNm4thLzuzSP9qreb9Kw/Vykg7oICVDwbvdjE+/JZjWpP9aT0 04lWRqRQ9UaKRMV4tQsU7k7jZDJ3klNaD0tpmPUQ= From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/41453] use INTENT(out) for optimization Date: Sun, 25 Sep 2022 20:32:05 +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: 4.5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: tkoenig 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: 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=3D41453 --- Comment #16 from Thomas Koenig --- (In reply to Mikael Morin from comment #15) > Status update: A lot of progress :-) > (In reply to Thomas Koenig from comment #5) > > Still missing: To clobber > >=20 > > - variables passed by reference to the caller > > - saved variables > > - associated variables (there are passed as pointers to > > the associate blocsk) > These have been done now. >=20 > Still missing: pointer or allocatable dummy. > Seems doable, probably a low hanging fruit. For an allocatable dummy, we have to deallocate on intent(out) anyway, and we do this on the caller's side, so we should not clobber.=20 For pointers, it could be an advantage. > > - intent(out) variables on entry to the procedure. > This remains to do. Again, sounds doable > Another case that could be handled is the case of arrays: > when the full array is passed as argument, and it is contiguous, and maybe > some other condition, we can clobber its decl. The hard part is the "may= be > some other condition". Not sure what that other condition could be. If we have a full array ref, = as per gfc_full_array_ref_p, and we pass this to an intent(out) argument, then that should be enough. > Not sure it's worth keeping this PR open. > Surely the initial test works as expected, and has been working for a long > time. There are still a few open points in relation to this. I would be in favor of keeping this open (to not lose the discussion) until we have them all fixed, or decide not to fix some or all of them.=