https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63854

--- Comment #34 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <l...@gcc.gnu.org>:

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

commit r12-7723-gbc84b61b00792ef38e1c2cd6b7280087e4fd2b57
Author: Marc Nieper-Wißkirchen <m...@nieper-wisskirchen.de>
Date:   Sat Mar 19 13:42:26 2022 -0400

    [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

    Before the patch, compiling the hello world example of libgccjit with
    the external driver under Valgrind shows a loss of 12,611 (48 direct)
    bytes.  After the patch, no memory leaks are reported anymore.
    (Memory leaks occurring when using the internal driver are mostly in
    the driver code in gcc/gcc.c and have to be fixed separately.)

    The patch has been tested by fully bootstrapping the compiler with the
    frontends C, C++, Fortran, LTO, ObjC, JIT and running the test suite
    under a x86_64-pc-linux-gnu host.

    gcc/ChangeLog:

            PR jit/63854
            * hash-traits.h (struct typed_const_free_remove): New.
            (struct free_string_hash): New.
            * pass_manager.h: Use free_string_hash.
            * passes.cc (pass_manager::register_pass_name): Use
free_string_hash.
            (pass_manager::~pass_manager): Delete allocated m_name_to_pass_map.

Reply via email to