From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29289 invoked by alias); 30 Apr 2013 11:58:46 -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 29261 invoked by uid 48); 30 Apr 2013 11:58:44 -0000 From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/56937] Unnecessarily temporary with array-vector assignments Date: Tue, 30 Apr 2013 11:58: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-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg02423.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56937 Thomas Koenig changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tkoenig at gcc dot gnu.org --- Comment #7 from Thomas Koenig 2013-04-30 11:58:43 UTC --- (In reply to comment #6) > Apparently there is no dependency analysis for array-vector assignments. Correct, however... > The > following test create a temporary that is not needed > > integer :: r(10), idx(4), jdx(4) > r = [(i+10,i=1,10)] > idx = [1, 2, 3, 4] > jdx = [6, 7, 8, 9] > r(idx) = r(jdx) > print *, r > end > > r(idx) = r(jdx) > 1 > Warning: Creating array temporary at (1) Currently, we do not support assigning values to variables and then later using the values for dependency analysis. This would require forward propagation of values, which we don't do in the front end. Plus, a lot of dependency test cases where we used variables to hide them from the optimization would start failing ;-)