This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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] (4/5-regression) PR61831 side-effect deallocation of variable components)


Dear Mikael,

I have gathered together the applicable patches to fix this PR on
5-branch. In so doing, the testcase for PR66082 was added
(alloc_comp_auto_array_3.f90), since a change was made for this PR. I
found that this leaked memory, of course, and so I have added the fix
for PR66082. I have checked that all the memory leaks mentioned in the
PR comments are fixed. The change in allocate_with_source_14.f03 is a
bit mysterious but I checked that it doesn't lose memory, so no harm
is done.

Bootstrapped and regtested on FC21/x86_64 - OK for 5-branch? (I
thought to commit it today, if that is OK?)

Cheers

Paul

2016-01-17  Mikael Morin  <mikael@gcc.gnu.org>

    Backport from trunk.
    PR fortran/61831
    * gfortran.dg/derived_constructor_components_6.f90: New file.
    * gfortran.dg/allocate_with_source_14.f03: Change count of
    __builtin_malloc from 21 to 23.

2016-01-17  Paul Thomas  <pault@gcc.gnu.org>

    Backport from trunk.
    PR fortran/66082
    * gfortran.dg/alloc_comp_auto_array_3.f90: New file. Count of
    __builtin_malloc increased from 3 to 4, relative to trunk.

2016-01-17  Mikael Morin  <mikael@gcc.gnu.org>
        Dominique d'Humieres  <dominiq@lps.ens.fr>

    Backport from trunk.
    PR fortran/61831
    * trans-array.c (gfc_conv_array_parameter): Guard allocatable
    component deallocation code generation with descriptorless
    calling convention flag.
    * trans-expr.c (gfc_conv_expr_reference): Remove allocatable
    component deallocation code generation from revision 212329.
    (expr_may_alias_variables): New function.
    (gfc_conv_procedure_call): New boolean elemental_proc to factor
    check for procedure elemental-ness.  Rename boolean f to nodesc_arg
    and declare it in the outer scope.  Use expr_may_alias_variables,
    elemental_proc and nodesc_arg to decide whether generate allocatable
    component deallocation code.
    (gfc_trans_subarray_assign): Set deep copy flag.

2016-01-17  Paul Thomas  <pault@gcc.gnu.org>

    Backport from trunk.
    PR fortran/66082
    * trans-array.c (gfc_conv_array_parameter): Ensure that all
    non-variable arrays with allocatable components have the
    components deallocated after the procedure call.


-- 
The difference between genius and stupidity is; genius has its limits.

Albert Einstein

Attachment: submit5.diff
Description: Text document


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