From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8755 invoked by alias); 20 Jan 2015 07:03:50 -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 8728 invoked by uid 48); 20 Jan 2015 07:03:44 -0000 From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/57023] [4.8/4.9/5 Regression] Not packing arrays with changing variable used for size Date: Tue, 20 Jan 2015 07:03: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: 4.9.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc assigned_to attachments.created 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-01/txt/msg01964.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57023 Thomas Koenig changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tkoenig at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |tkoenig at gcc dot gnu.org --- Comment #6 from Thomas Koenig --- Created attachment 34493 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34493&action=edit Proposed patch This patch creates a temporary if a bound of the array contains a dummy variable which is not INTENT(IN) (so it could potentially be changed by the user). Modern code should always have INTENT(IN) for something passed as array bounds, anyway. We should be correct for all cases, but not try to optimize the pathological ones.