From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 953253858C52; Sun, 25 Sep 2022 16:42:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 953253858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664124135; bh=gvE/NhsTscnGa2jZnqe9ChpR/4UA4mdmrAwwCqkAqbg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PgomvItawVPYqOv4GMMXLQ9cFv9X8fHPUMbPckOMQePPhdzUlo0g2fFOIUiNcgVRI 6D2RBINYnJIEv2j8rZyxFxorwGLAo+sJljRf2uQGqc4ZzGfYl0WcMpAtHPw95Mg1Sx KZkYV3fhYba6qfh70yghNWZ9rlSW3ebul9rNcLDc= From: "mikael 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 16:42:15 +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: mikael 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=3D41453 Mikael Morin changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mikael at gcc dot gnu.org --- Comment #15 from Mikael Morin --- Status update: (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. Still missing: pointer or allocatable dummy. Seems doable, probably a low hanging fruit. > - intent(out) variables on entry to the procedure. This remains to do. (In reply to Thomas Koenig from comment #7) > Also still to do: Do some more precise clobbering for > the case of PR88364, i.e. for >=20 > call foo(a&x) >=20 > clobber a%x, which is currently not done. This is impossible for now on the caller side because of lack of middle-end support: only full variable declarations can be clobbered, or pointer targe= ts. There was a patch to handle the case above, but it was dropped for that rea= son. See: https://gcc.gnu.org/pipermail/fortran/2022-September/058181.html Maybe part of that patch can be resurrected, but restricted to the case of allocatable or pointer components. 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 "maybe some other condition". Not sure it's worth keeping this PR open. Surely the initial test works as expected, and has been working for a long time.=