]> git.ipfire.org Git - thirdparty/gcc.git/commit
jit: reset state in varasm.cc [PR117275]
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 23 Oct 2024 18:26:38 +0000 (14:26 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 23 Oct 2024 18:26:38 +0000 (14:26 -0400)
commit779c0390e3b57d1eebd41bbfe43d1f329c91de6c
tree22cbc727abc54078e01845f07ce7a46aa46e74b8
parent9ffcf1f193b477f417a4c1960cd32696a23b99b4
jit: reset state in varasm.cc [PR117275]

PR jit/117275 reports various jit test failures seen on
powerpc64le-unknown-linux-gnu due to hitting this assertion
in varasm.cc on the 2nd compilation in a process:

#2  0x00007ffff63e67d0 in assemble_external_libcall (fun=0x7ffff2a4b1d8)
    at ../../src/gcc/varasm.cc:2650
2650          gcc_assert (!pending_assemble_externals_processed);
(gdb) p pending_assemble_externals_processed
$1 = true

We're not properly resetting state in varasm.cc after a compile
for libgccjit.

Fixed thusly.

gcc/ChangeLog:
PR jit/117275
* toplev.cc (toplev::finalize): Call varasm_cc_finalize.
* varasm.cc (varasm_cc_finalize): New.
* varasm.h (varasm_cc_finalize): New decl.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/toplev.cc
gcc/varasm.cc
gcc/varasm.h