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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by David Malcolm
<dmalc...@gcc.gnu.org>:

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

commit r14-10856-gacc0b9ff9cf1bcfed63812ca223251485b6471b7
Author: David Malcolm <dmalc...@redhat.com>
Date:   Wed Oct 30 16:11:41 2024 -0400

    jit: fix leak of pending_assemble_externals_set [PR117275]

    My recent r15-4580-g779c0390e3b57d fix for resetting state in
    varasm.cc introduced some noise to "make selftest-valgrind" and,
    presumably, a memory leak in libgccjit:

    ==2462086== 160 (56 direct, 104 indirect) bytes in 1 blocks are definitely
lost in loss record 248 of 352
    ==2462086==    at 0x5270E7D: operator new(unsigned long)
(vg_replace_malloc.c:342)
    ==2462086==    by 0x1D1EB89: init_varasm_once() (varasm.cc:6806)
    ==2462086==    by 0x181C845: backend_init() (toplev.cc:1826)
    ==2462086==    by 0x181D41A: do_compile() (toplev.cc:2193)
    ==2462086==    by 0x181D99C: toplev::main(int, char**) (toplev.cc:2371)
    ==2462086==    by 0x378391D: main (main.cc:39)

    Fixed thusly.

    gcc/ChangeLog:
            PR jit/117275
            * varasm.cc (process_pending_assemble_externals): Reset
            pending_assemble_externals_set to nullptr after deleting it.
            (varasm_cc_finalize): Delete pending_assemble_externals_set.

    Signed-off-by: David Malcolm <dmalc...@redhat.com>
    (cherry picked from commit 7f41203f08b9948c1c636dc9d66571121c6c7793)
    Signed-off-by: David Malcolm <dmalc...@redhat.com>

Reply via email to