[Bug fortran/108925] memory leak of gfc_get_namespace result

2023-03-08 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108925 --- Comment #7 from anlauf at gcc dot gnu.org --- (In reply to Mikael Morin from comment #6) > Created attachment 54598 [details] > Tentative patch > This seems to work on the reduced testcases, can't fully test right now. I tried it and killed

[Bug fortran/108925] memory leak of gfc_get_namespace result

2023-03-07 Thread mikael at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108925 --- Comment #6 from Mikael Morin --- Created attachment 54598 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54598&action=edit Tentative patch Indeed the namespaces created during module loading are not stored anywhere, so they are leaked

[Bug fortran/108925] memory leak of gfc_get_namespace result

2023-03-06 Thread mikael at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108925 --- Comment #5 from Mikael Morin --- This does NOT improve things: diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc index 601497e0998..2d6c7b8ef73 100644 --- a/gcc/fortran/module.cc +++ b/gcc/fortran/module.cc @@ -5258,7 +5258,10 @@ r

[Bug fortran/108925] memory leak of gfc_get_namespace result

2023-03-06 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108925 --- Comment #4 from anlauf at gcc dot gnu.org --- Also: MODULE m contains subroutine bar (arg, res) class(*) :: arg character(100) :: res end subroutine END MODULE USE m END

[Bug fortran/108925] memory leak of gfc_get_namespace result

2023-03-06 Thread mikael at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108925 --- Comment #3 from Mikael Morin --- (In reply to anlauf from comment #2) > The attachment in pr68800 may serve as a starting point: > > https://gcc.gnu.org/bugzilla/attachment.cgi?id=36964 Thanks, reduced: MODULE m TYPE :: a END TYPE END

[Bug fortran/108925] memory leak of gfc_get_namespace result

2023-03-06 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108925 anlauf at gcc dot gnu.org changed: What|Removed |Added CC||anlauf at gcc dot gnu.org --

[Bug fortran/108925] memory leak of gfc_get_namespace result

2023-03-06 Thread mikael at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108925 Mikael Morin changed: What|Removed |Added CC||mikael at gcc dot gnu.org --- Comment #1