This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, fortran] PR66079 - [6 Regression] memory leak with source allocation in internal subprogram


Dear All,

This patch started out fixing a single source of memory leak and then
went on to fix various other issues that I found upon investigation.

The fortran ChangeLog entry is sufficiently descripive that I do not
think that there is a need to say more.

Bootstrapped and regtested on x86_64/FC21 - OK for trunk?

I am rather sure that some of the issues go further back than 6.0. I
will investigate what should be fixed for 5.2.

Cheers

Paul

2015-05-23  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): Prevent memory leaks by
    not evaluating expr3 for scalar derived types with allocatable
    components. Fixed character length allocatable results and
    dummies need to be dereferenced. Also, if al_len is NULL use
    memsz for the string copy.

2015-05-23  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/66079
    * gfortran.dg/allocatable_scalar_13.f90: New test

Attachment: check2305.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]