From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90537 invoked by alias); 18 Oct 2015 18:37:29 -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 90437 invoked by uid 55); 18 Oct 2015 18:37:25 -0000 From: "pault at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/66079] [5 Regression] memory leak with source allocation in internal subprogram Date: Sun, 18 Oct 2015 18:37: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: pault at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.3 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-10/txt/msg01430.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66079 --- Comment #12 from Paul Thomas --- Author: pault Date: Sun Oct 18 18:36:52 2015 New Revision: 228952 URL: https://gcc.gnu.org/viewcvs?rev=228952&root=gcc&view=rev Log: 2015-10-18 Paul Thomas PR fortran/66079 * trans-expr.c (gfc_conv_procedure_call): Allocatable scalar function results must be freed and nullified after use. Create a temporary to hold the result to prevent duplicate calls. * trans-stmt.c (gfc_trans_allocate): Rename temporary variable as 'source'. Deallocate allocatable components of non-variable 'source's. 2015-10-18 Paul Thomas PR fortran/66079 * gfortran.dg/allocatable_scalar_13.f90: New test Added: branches/gcc-5-branch/gcc/testsuite/gfortran.dg/allocatable_scalar_13.f90 Modified: branches/gcc-5-branch/gcc/fortran/ChangeLog branches/gcc-5-branch/gcc/fortran/trans-expr.c branches/gcc-5-branch/gcc/fortran/trans-stmt.c branches/gcc-5-branch/gcc/testsuite/ChangeLog