From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20195 invoked by alias); 8 Feb 2015 13:00:14 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20119 invoked by uid 48); 8 Feb 2015 13:00:10 -0000 From: "mikael at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/64952] Missing temporary in assignment from elemental function Date: Sun, 08 Feb 2015 13:00:00 -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: 5.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mikael at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pault 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg00688.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64952 --- Comment #4 from Mikael Morin --- Hello Paul, setting potentially_aliased should be done inside gfc_walk_elemental_function_args, as the ss argument may be returned unmodified. In fact, I think it's better to do all the trans-array.c code inside gfc_conv_resolve_dependencies without adding the gfc_ss_info flag. There is also the case of typebound procedures and procedure pointer components, for which we should generate a temporary in any case. I think this case is something that was overlooked by the standard commitee when they introduced the PURE attribute. Maybe they can provide some kind of "REALLY_PURE" attribute (or PURE ELEMENTAL, different from regular ELEMENTAL) that avoids generating temporaries everywhere? Or maybe the function Fred should bee IMPURE ELEMENTAL? Anyway, I think we should not rush to fix this before we are sure that the standard committee really expects temporaries (almost) everywhere array elemental functions are involved.