From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36439 invoked by alias); 1 Jul 2015 14:24:57 -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 36393 invoked by uid 48); 1 Jul 2015 14:24:53 -0000 From: "vehre at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/66578] [F2008] Invalid free on allocate(...,source=a(:)) in block Date: Wed, 01 Jul 2015 14:24: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: 6.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: vehre at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: vehre at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete 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-07/txt/msg00052.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66578 vehre at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35806|0 |1 is obsolete| | --- Comment #17 from vehre at gcc dot gnu.org --- Created attachment 35887 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35887&action=edit Extended version of Mikael's patch I have encountered some other issues with the patch for 44672 that are not fixed by Mikael's patch. Using Mikael's patch as a base I could resolve these issues: - when the rank in an assignment was decreased (i.e., the rank of the object(!) on the rhs was greater then the one needed for the assignment, e.q. selecting a row from a matrix, testcases are allocate_with_source_7/8), - twice indirect element addressing (e.q. using a section of a vector of indices to address elements in a second array, as in the new testcase allocate_with_source_9.f08 provided by the patch), and - fixing char_length_8. In most cases the issues occurred because the offset was not set correctly when rebasing to one for the lower bound. Please have look whether the things to accomplish can be done easier. This patch bootstraps and regtests fine x86_64-linux-gnu/f21.