Skip to content

Commit f77f479

Browse files
zhaozhouchenglulu326
authored andcommitted
LoongArch: Fix issue where data marked as GTY is cleaned up by ggc.
As for GGC(GCC Garbage Collection), it's use gengtype tool to scan all source files contain the GTY mark, and generate gt-*.h files. GGC traversal these file to find gt_root node and marks these objects that directly or indirectly reference this node as active, then clean up unmarked object's memory. For the loongarch-builtins.cc file, it is necessary to add target_gtfiles in config.gcc to generate gt-loongarch-builtins.h, and include this header file in the .cc file, prevented the data marked with GTY in this `.cc` file cleaned up by ggc. gcc/ChangeLog: * config.gcc: Add target_gtfiles. * config/loongarch/loongarch-builtins.cc: Add header file.
1 parent 890dff6 commit f77f479

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

gcc/config.gcc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ loongarch*-*-*)
502502
extra_headers="larchintrin.h lsxintrin.h lasxintrin.h"
503503
extra_objs="loongarch-c.o loongarch-builtins.o loongarch-cpu.o loongarch-opts.o loongarch-def.o loongarch-evolution.o loongarch-target-attr.o"
504504
extra_gcc_objs="loongarch-driver.o loongarch-cpu.o loongarch-opts.o loongarch-def.o"
505+
target_gtfiles="\$(srcdir)/config/loongarch/loongarch-builtins.cc"
505506
extra_options="${extra_options} g.opt fused-madd.opt"
506507
;;
507508
nds32*)

gcc/config/loongarch/loongarch-builtins.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3259,3 +3259,5 @@ loongarch_build_builtin_va_list (void)
32593259
{
32603260
return ptr_type_node;
32613261
}
3262+
3263+
#include "gt-loongarch-builtins.h"

0 commit comments

Comments
 (0)