This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/66079] [6 Regression] memory leak with source allocation in internal subprogram
- From: "pault at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 11 Jun 2015 15:50:04 +0000
- Subject: [Bug fortran/66079] [6 Regression] memory leak with source allocation in internal subprogram
- Auto-submitted: auto-generated
- References: <bug-66079-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66079
--- Comment #6 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Thu Jun 11 15:49:32 2015
New Revision: 224383
URL: https://gcc.gnu.org/viewcvs?rev=224383&root=gcc&view=rev
Log:
2015-06-11 Paul Thomas <pault@gcc.gnu.org>
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-06-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/66079
* gfortran.dg/allocatable_scalar_13.f90: New test
Added:
trunk/gcc/testsuite/gfortran.dg/allocatable_scalar_13.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans-stmt.c
trunk/gcc/testsuite/ChangeLog