[Bug fortran/37336] [F03] Finish derived-type finalization

2024-04-08 Thread vterzi1996 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

Vladimir Terzi  changed:

   What|Removed |Added

 CC||vterzi1996 at gmail dot com

--- Comment #38 from Vladimir Terzi  ---
It appears that gfortran-13.1 forgets to finalize an instance in the
initialization using the ALLOCATE statement with SOURCE (e.g.,
`allocate(obj,source=type())`). This behavior differs from the assignment
(e.g., `obj=type()`). The "constructor" was redefined with an interface.

I already created a bug report
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114613), but a person from Stack
Overflow pointed me to this thread.

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-11-28 Thread andrewjenner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 110415, which changed state.

Bug 110415 Summary: (Re)allocation on assignment to allocatable polymorphic 
variable from allocatable polymorphic function result
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110415

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-10-04 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 111674, which changed state.

Bug 111674 Summary: [13/14 regression] Failure to finalize an allocatable 
subobject of a non-finalizable type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111674

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-10-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

--- Comment #37 from CVS Commits  ---
The releases/gcc-13 branch has been updated by Paul Thomas :

https://gcc.gnu.org/g:29cd67f93f00cc7a9b08eae4f3e12e67ed568f19

commit r13-7934-g29cd67f93f00cc7a9b08eae4f3e12e67ed568f19
Author: Paul Thomas 
Date:   Wed Oct 4 08:26:35 2023 +0100

Fortran: Alloc comp of non-finalizable type not finalized [PR111674]

2023-10-04  Paul Thomas  

gcc/fortran
PR fortran/37336
PR fortran/111674
* trans-expr.cc (gfc_trans_scalar_assign): Finalize components
on deallocation if derived type is not finalizable.

gcc/testsuite/
PR fortran/37336
PR fortran/111674
* gfortran.dg/allocate_with_source_25.f90: Final count in tree
dump reverts from 4 to original 6.
* gfortran.dg/finalize_38.f90: Add test for fix of PR111674.

(cherry picked from commit 84284e1c490e9235fca5cb85269ecfcb87eef4f1)

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-10-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

--- Comment #36 from CVS Commits  ---
The master branch has been updated by Paul Thomas :

https://gcc.gnu.org/g:84284e1c490e9235fca5cb85269ecfcb87eef4f1

commit r14-4390-g84284e1c490e9235fca5cb85269ecfcb87eef4f1
Author: Paul Thomas 
Date:   Wed Oct 4 08:26:35 2023 +0100

Fortran: Alloc comp of non-finalizable type not finalized [PR111674]

2023-10-04  Paul Thomas  

gcc/fortran
PR fortran/37336
PR fortran/111674
* trans-expr.cc (gfc_trans_scalar_assign): Finalize components
on deallocation if derived type is not finalizable.

gcc/testsuite/
PR fortran/37336
PR fortran/111674
* gfortran.dg/allocate_with_source_25.f90: Final count in tree
dump reverts from 4 to original 6.
* gfortran.dg/finalize_38.f90: Add test for fix of PR111674.

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-09-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

--- Comment #35 from CVS Commits  ---
The releases/gcc-13 branch has been updated by Andre Vehreschild
:

https://gcc.gnu.org/g:d9b3269bdccac2db9200303494c4e82f2aeb7bbc

commit r13-7923-gd9b3269bdccac2db9200303494c4e82f2aeb7bbc
Author: Andre Vehreschild 
Date:   Thu Sep 28 09:30:12 2023 +0200

Fortran: Free alloc. comp. in allocated coarrays only.

When freeing allocatable components of an allocatable coarray, add
a check that the coarray is still allocated, before accessing the
components.

This patch adds to PR fortran/37336, but does not fix it completely.

gcc/fortran/ChangeLog:
PR fortran/37336
* trans-array.cc (structure_alloc_comps): Deref coarray.
(gfc_trans_deferred_array): Add freeing of components after
check for allocated coarray.

gcc/testsuite/ChangeLog:
PR fortran/37336
* gfortran.dg/coarray/alloc_comp_6.f90: New test.
* gfortran.dg/coarray/alloc_comp_7.f90: New test.

(cherry picked from commit 9a63a62dfd73e159f1956e9b04b555c445de4e78)

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-09-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

--- Comment #34 from CVS Commits  ---
The master branch has been updated by Andre Vehreschild :

https://gcc.gnu.org/g:a680274616ec6b26ccfdcee400ed7f54e341d40c

commit r14-4331-ga680274616ec6b26ccfdcee400ed7f54e341d40c
Author: Andre Vehreschild 
Date:   Thu Sep 28 09:30:12 2023 +0200

Fortran: Free alloc. comp. in allocated coarrays only.

When freeing allocatable components of an allocatable coarray, add
a check that the coarray is still allocated, before accessing the
components.

This patch adds to PR fortran/37336, but does not fix it completely.

gcc/fortran/ChangeLog:
PR fortran/37336
* trans-array.cc (structure_alloc_comps): Deref coarray.
(gfc_trans_deferred_array): Add freeing of components after
check for allocated coarray.

gcc/testsuite/ChangeLog:
PR fortran/37336
* gfortran.dg/coarray/alloc_comp_6.f90: New test.
* gfortran.dg/coarray/alloc_comp_7.f90: New test.

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-05-22 Thread trnka at scm dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

Tomáš Trnka  changed:

   What|Removed |Added

 CC||trnka at scm dot com

--- Comment #33 from Tomáš Trnka  ---
The fix for this seems to break some fairly unsuspecting code on GCC 13, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109684

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-04-14 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 91316, which changed state.

Bug 91316 Summary: Derived type finalization failing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91316

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-04-14 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 84472, which changed state.

Bug 84472 Summary: Missing finalization and memory leak
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84472

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-04-14 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 65347, which changed state.

Bug 65347 Summary: [F03] Final subroutine not called for function result
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65347

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 107914, which changed state.

Bug 107914 Summary: Finalization errors
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107914

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 106576, which changed state.

Bug 106576 Summary: Finalization of temporaries from functions not occuring
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106576

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 104382, which changed state.

Bug 104382 Summary: Finalization of parent components not compliant with 
standard
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104382

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 96122, which changed state.

Bug 96122 Summary: Segfault when using finalizer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96122

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 93691, which changed state.

Bug 93691 Summary: Type bound assignment causes too many finalization of 
derived type when part of other type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93691

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 88735, which changed state.

Bug 88735 Summary: Nested assignment triggers call of final method for right 
hand side
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88735

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 82996, which changed state.

Bug 82996 Summary: ICE and segfault with derived type finalization
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82996

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 80524, which changed state.

Bug 80524 Summary: [F03] Problematic behaviour with a finalization subroutine 
in gfortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80524

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 71798, which changed state.

Bug 71798 Summary: [OOP] failure to finalise temporary
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71798

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 69298, which changed state.

Bug 69298 Summary: [OOP] Array finalisers seem to be given the wrong array when 
the array is a member variable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69298

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 67471, which changed state.

Bug 67471 Summary: [F03] Finalizer not invoked for assignment to array section
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67471

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 67444, which changed state.

Bug 67444 Summary: [F03] RHS in assignment of polymorphic types not finalized
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67444

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 64290, which changed state.

Bug 64290 Summary: [F03] No finalization at deallocation of LHS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64290

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 59694, which changed state.

Bug 59694 Summary: [F03] no finalization of an unused variable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59694

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2023-03-18 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

--- Comment #32 from CVS Commits  ---
The master branch has been updated by Paul Thomas :

https://gcc.gnu.org/g:d7caf313525a46f200d7f5db1ba893f853774aee

commit r13-6747-gd7caf313525a46f200d7f5db1ba893f853774aee
Author: Paul Thomas 
Date:   Sat Mar 18 07:56:23 2023 +

Fortran: Fix bugs and missing features in finalization [PR37336]

2023-03-18  Paul Thomas  

gcc/fortran
PR fortran/103854
PR fortran/96122
PR fortran/37336
* class.cc (finalize_component): Include the missing arguments
in the call to the component's finalizer wrapper.
(has_finalizer_component): Do not return true for procedure
pointer components.
(finalizer_insert_packed_call): Remove the redundant argument
in the call to the final subroutine.
(generate_finalization_wrapper): Add support for assumed rank
finalizers.
(gfc_may_be_finalized): New helper function.
* dump-parse-tree.cc (write_proc): Whitespace.
* gfortran.h : Add prototype for gfc_may_be_finalized.
* resolve.cc (resolve_function): Correct derived types that
have an incomplete namespace.
(resolve_where, gfc_resolve_where_code_in_forall,
gfc_resolve_forall_body, gfc_resolve_code): Check that the op
code is still EXEC_ASSIGN. If it is set lhs to must finalize.
(is_finalizable_type): New function.
(generate_component_assignments): Set must_finalize if needed.
(gfc_resolve_finalizers): Error if assumed rank finalizer is
not the only one. Warning on lack of scalar finalizer modified
to account for assumed rank finalizers.
(generate_final_call): New function.
(generate_component_assignments): Enclose the outermost call in
a block to capture automatic deallocation and final calls.
Set must_finalize as required to satisfy the standards. Use an
explicit pointer assignment for pointer components to capture
finalization of the target. Likewise use explicit assignment
for allocatable components. Do not use the temporary copy of
the lhs in defined assignment if the component is allocatable.
Put the temporary in the same namespace as the lhs symbol if
the component may be finalized. Remove the leading assignment
from the expansion of assignment of components that have their
own defined assignment components. Suppress finalization of
assignment of temporary components to the lhs. Make an explicit
final call for the rhs function temporary if it exists.
(gfc_resolve_code): Set must_finalize for assignments with an
array constructor on the rhs.
(gfc_resolve_finalizers): Ensure that an assumed rank finalizer
is the only finalizer for that type and correct the surprising
warning for the lack of a scalar finalizer.
(check_defined_assignments): Handle allocatable components.
(resolve_fl_derived): Set referenced the vtab for use
associated symbols.
(resolve_symbol): Set referenced an unreferenced symbol that
will be finalized.
* trans-array.cc (gfc_trans_array_constructor_value): Add code
to finalize the constructor result. Warn that this feature was
removed in F2018 and that it is suppressed by -std=2018.
(trans_array_constructor): Add finalblock, pass to previous
and apply to loop->post if filled.
(gfc_add_loop_ss_code): Add se finalblock to outer loop post.
(gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
generated finalization code to the main block.
(structure_alloc_comps): Add boolean argument to suppress
finalization and use it for calls from
gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
false.
(gfc_copy_alloc_comp_no_fini): New wrapper for
structure_alloc_comps.
(gfc_alloc_allocatable_for_assignment): Suppress finalization
by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
(gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
deallocate the components of entities with a leading '_' in the
name that are also marked as artificial.
* trans-array.h : Add the new boolean argument to the prototype
of gfc_deallocate_alloc_comp_no_caf with a default of false.
Add prototype for gfc_copy_alloc_comp_no_fini.
* trans-decl.cc(init_intent_out_dt): Tidy up the code.
* trans-expr.cc (gfc_init_se): Initialize finalblock.

[Bug fortran/37336] [F03] Finish derived-type finalization

2022-02-03 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 91648, which changed state.

Bug 91648 Summary: [9/10/11/12 Regression] ICE in 
generate_finalization_wrapper, at fortran/class.c:2009
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91648

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2022-02-01 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 70863, which changed state.

Bug 70863 Summary: [F03] Finalization of array of derived type causes segfault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70863

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug fortran/37336] [F03] Finish derived-type finalization

2021-11-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

--- Comment #31 from CVS Commits  ---
The master branch has been updated by Bernhard Reutner-Fischer
:

https://gcc.gnu.org/g:8875a92d31329ae52b734683784c4b054839a661

commit r12-5073-g8875a92d31329ae52b734683784c4b054839a661
Author: Bernhard Reutner-Fischer 
Date:   Fri Oct 12 23:57:21 2018 +0200

Fortran: Fix memory leak in finalization wrappers [PR68800]

If a finalization is not required we created a namespace containing
formal arguments for an internal interface definition but never used
any of these. So the whole sub_ns namespace was not wired up to the
program and consequently was never freed. The fix is to simply not
generate any finalization wrappers if we know that it will be unused.
Note that this reverts back to the original r190869
(8a96d64282ac534cb597f446f02ac5d0b13249cc) handling for this case
by reverting this specific part of r194075
(f1ee56b4be7cc3892e6ccc75d73033c129098e87) for PR fortran/37336.

valgrind summary for e.g.
gfortran.dg/abstract_type_3.f03 and gfortran.dg/abstract_type_4.f03
where ".orig" is pristine trunk and ".mine" contains this fix:

at3.orig.vg:LEAK SUMMARY:
at3.orig.vg-   definitely lost: 8,460 bytes in 11 blocks
at3.orig.vg-   indirectly lost: 13,288 bytes in 55 blocks
at3.orig.vg- possibly lost: 0 bytes in 0 blocks
at3.orig.vg-   still reachable: 572,278 bytes in 2,142 blocks
at3.orig.vg-suppressed: 0 bytes in 0 blocks
at3.orig.vg-
at3.orig.vg-Use --track-origins=yes to see where uninitialised values come
from
at3.orig.vg-ERROR SUMMARY: 38 errors from 33 contexts (suppressed: 0 from
0)
--
at3.mine.vg:LEAK SUMMARY:
at3.mine.vg-   definitely lost: 344 bytes in 1 blocks
at3.mine.vg-   indirectly lost: 7,192 bytes in 18 blocks
at3.mine.vg- possibly lost: 0 bytes in 0 blocks
at3.mine.vg-   still reachable: 572,278 bytes in 2,142 blocks
at3.mine.vg-suppressed: 0 bytes in 0 blocks
at3.mine.vg-
at3.mine.vg-ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
at3.mine.vg-ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
at4.orig.vg:LEAK SUMMARY:
at4.orig.vg-   definitely lost: 13,751 bytes in 12 blocks
at4.orig.vg-   indirectly lost: 11,976 bytes in 60 blocks
at4.orig.vg- possibly lost: 0 bytes in 0 blocks
at4.orig.vg-   still reachable: 572,278 bytes in 2,142 blocks
at4.orig.vg-suppressed: 0 bytes in 0 blocks
at4.orig.vg-
at4.orig.vg-Use --track-origins=yes to see where uninitialised values come
from
at4.orig.vg-ERROR SUMMARY: 18 errors from 16 contexts (suppressed: 0 from
0)
--
at4.mine.vg:LEAK SUMMARY:
at4.mine.vg-   definitely lost: 3,008 bytes in 3 blocks
at4.mine.vg-   indirectly lost: 4,056 bytes in 11 blocks
at4.mine.vg- possibly lost: 0 bytes in 0 blocks
at4.mine.vg-   still reachable: 572,278 bytes in 2,142 blocks
at4.mine.vg-suppressed: 0 bytes in 0 blocks
at4.mine.vg-
at4.mine.vg-ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
at4.mine.vg-ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)

gcc/fortran/ChangeLog:

2018-10-12  Bernhard Reutner-Fischer  

PR fortran/68800
* class.c (generate_finalization_wrapper): Do not leak
finalization wrappers if they will not be used.
* expr.c (gfc_free_actual_arglist): Formatting fix.
* gfortran.h (gfc_free_symbol): Pass argument by reference.
(gfc_release_symbol): Likewise.
(gfc_free_namespace): Likewise.
* symbol.c (gfc_release_symbol): Adjust acordingly.
(free_components): Set procedure pointer components
of derived types to NULL after freeing.
(free_tb_tree): Likewise.
(gfc_free_symbol): Set sym to NULL after freeing.
(gfc_free_namespace): Set namespace to NULL after freeing.

[Bug fortran/37336] [F03] Finish derived-type finalization

2020-07-13 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

[Bug fortran/37336] [F03] Finish derived-type finalization

2020-06-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 94109, which changed state.

Bug 94109 Summary: [8/9/10/11 Regression] Memory leak introduced in 8.3.0->8.3.1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94109

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2020-06-01 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 94361, which changed state.

Bug 94361 Summary: [8/9/10/11 Regression] Memory leak in nested types with final
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94361

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2019-07-01 Thread juergen.reuter at desy dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

--- Comment #30 from Jürgen Reuter  ---
Are there any plans on finishing the finalization implementation? To me it
looks that the missing cases are the last open issues (besides some minor known
bug) to claim complete F2003 implementation.

[Bug fortran/37336] [F03] Finish derived-type finalization

2019-03-23 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 64777, which changed state.

Bug 64777 Summary: [Coarray] CO_BROADCAST: Finalization/dealloc of alloc 
components missing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64777

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

[Bug fortran/37336] [F03] Finish derived-type finalization

2017-05-09 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 79311, which changed state.

Bug 79311 Summary: [OOP] ICE in generate_finalization_wrapper, at 
fortran/class.c:1992
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79311

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2017-04-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 67505, which changed state.

Bug 67505 Summary: [F03] bogus runtime error with final subroutine and 
-fcheck=recursion
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67505

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug fortran/37336] [F03] Finish derived-type finalization

2016-12-09 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 61767, which changed state.

Bug 61767 Summary: [OOP] ICE in generate_finalization_wrapper at 
fortran/class.c:1491
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61767

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2016-12-04 Thread damian at sourceryinstitute dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 59694, which changed state.

Bug 59694 Summary: [F03] no finalization of an unused variable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59694

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

[Bug fortran/37336] [F03] Finish derived-type finalization

2016-12-03 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 58175, which changed state.

Bug 58175 Summary: [OOP] Incorrect warning message on scalar finalizer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58175

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2016-12-01 Thread damian at sourceryinstitute dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 59694, which changed state.

Bug 59694 Summary: [F03] no finalization of an unused variable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59694

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

[Bug fortran/37336] [F03] Finish derived-type finalization

2016-11-30 Thread abensonca at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 58175, which changed state.

Bug 58175 Summary: [OOP] Incorrect warning message on scalar finalizer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58175

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

[Bug fortran/37336] [F03] Finish derived-type finalization

2016-11-29 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 58175, which changed state.

Bug 58175 Summary: [OOP] Incorrect warning message on scalar finalizer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58175

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug fortran/37336] [F03] Finish derived-type finalization

2015-11-07 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 66577, which changed state.

Bug 66577 Summary: ICE in generate_finalization_wrapper, at fortran/class.c:1567
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66577

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug fortran/37336] [F03] Finish derived-type finalization

2015-09-25 Thread mikael at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 55603, which changed state.

Bug 55603 Summary: [F03] Memory leak with scalar allocatable function result
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55603

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED


[Bug fortran/37336] [F03] Finish derived-type finalization

2015-09-07 Thread ian_harvey at bigpond dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 67472, which changed state.

Bug 67472 Summary: Finalizer not invoked for undefined and unreferenced local 
variable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67472

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE


[Bug fortran/37336] [F03] Finish derived-type finalization

2015-09-03 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 66291, which changed state.

Bug 66291 Summary: [OOP] Incorrect compile time warning for final procedure in 
gfortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66291

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE


[Bug fortran/37336] [F03] Finish derived-type finalization

2015-09-03 Thread fxcoudert at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 43849, which changed state.

Bug 43849 Summary: Add _gfortran_finalize function to close down the library
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX


[Bug fortran/37336] [F03] Finish derived-type finalization

2015-02-15 Thread sourcery at rouson dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

--- Comment #29 from sourcery at rouson dot net ---
Good news. 

Hopefully you saw the email about the tutorial proposals. Strangely ISC asks
for 1/2 page CVs, which I interpret as half-page CVs (Karla was hoping they
meant 1-2 page, but I think we should err on the safer side. You'll probably
want to checkout the reduced version I constructed for you.  


D

D

Sent from my iPhone

 On Feb 15, 2015, at 8:03 AM, dominiq at lps dot ens.fr 
 gcc-bugzi...@gcc.gnu.org wrote:
 
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
 Bug 37336 depends on bug 59765, which changed state.
 
 Bug 59765 Summary: [4.9/5 Regression] [OOP] ICE on valid with finalizable 
 array components
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59765
 
   What|Removed |Added
 
 Status|NEW |RESOLVED
 Resolution|--- |FIXED
 
 -- 
 You are receiving this mail because:
 You are on the CC list for the bug.



[Bug fortran/37336] [F03] Finish derived-type finalization

2015-02-15 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 59765, which changed state.

Bug 59765 Summary: [4.9/5 Regression] [OOP] ICE on valid with finalizable array 
components
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59765

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED


[Bug fortran/37336] [F03] Finish derived-type finalization

2014-12-15 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

--- Comment #28 from janus at gcc dot gnu.org ---
(In reply to janus from comment #27)
 Currently missing are:
 
 a) Finalization of the LHS during intrinsic assignment:

aka PR 64290


[Bug fortran/37336] [F03] Finish derived-type finalization

2014-03-18 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 55207, which changed state.

Bug 55207 Summary: [F08] Variables declared in the main program should 
implicitly get the SAVE attribute
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55207

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---


[Bug fortran/37336] [F03] Finish derived-type finalization

2014-03-15 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 55207, which changed state.

Bug 55207 Summary: [F08] Variables declared in the main program should 
implicitly get the SAVE attribute
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55207

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED


[Bug fortran/37336] [F03] Finish derived-type finalization

2014-02-08 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336
Bug 37336 depends on bug 58470, which changed state.

Bug 58470 Summary: [4.9 Regression] [OOP] ICE on invalid with FINAL procedure 
and type extension
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58470

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED


[Bug fortran/37336] [F03] Finish derived-type finalization

2014-01-12 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

Bug 37336 depends on bug 58026, which changed state.

Bug 58026 Summary: [F03] Bad error recovery for allocatable component of 
undeclared type
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58026

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED


[Bug fortran/37336] [F03] Finish derived-type finalization

2013-12-20 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336

--- Comment #27 from janus at gcc dot gnu.org ---
From http://gcc.gnu.org/ml/fortran/2013-12/msg00104.html ...

Currently missing are:

a) Finalization of the LHS during intrinsic assignment:
b) Finalization of functions results after their use
c) Finalization of structure/array constructors after their use.