This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/66079] [5 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: Sun, 18 Oct 2015 18:37:24 +0000
- Subject: [Bug fortran/66079] [5 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 #12 from Paul Thomas <pault at gcc dot gnu.org> ---
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 <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-10-18 Paul Thomas <pault@gcc.gnu.org>
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