From 5935baf5bb52209ed2e8fa0f435e19bd4e0507db Mon Sep 17 00:00:00 2001 From: Joern Rennecke Date: Wed, 3 Jul 2019 00:22:53 +0000 Subject: [PATCH] re PR testsuite/91065 (gcc.dg/plugin/start_unit_plugin.c uses ggc memory without registering a root_tab) PR testsuite/91065 * testsuite/gcc.dg/plugin/start_unit_plugin.c: Register a root tab to reference fake_var. From-SVN: r272954 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/plugin/start_unit_plugin.c | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62b126fb5b8..c7fed52b573 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-07-02 Joern Rennecke + + PR testsuite/91065 + * testsuite/gcc.dg/plugin/start_unit_plugin.c: Register a root tab + to reference fake_var. + 2019-07-02 qing zhao PR preprocessor/90581 diff --git a/gcc/testsuite/gcc.dg/plugin/start_unit_plugin.c b/gcc/testsuite/gcc.dg/plugin/start_unit_plugin.c index b98cf55eddd..61e9494038c 100644 --- a/gcc/testsuite/gcc.dg/plugin/start_unit_plugin.c +++ b/gcc/testsuite/gcc.dg/plugin/start_unit_plugin.c @@ -40,6 +40,19 @@ gate_start_unit (void) static void start_unit_callback (void *gcc_data, void *user_data) { + static const struct ggc_root_tab root[] = { + { + &fake_var, + 1, + sizeof (fake_var), + >_ggc_mx_tree_node, + >_pch_nx_tree_node + }, + LAST_GGC_ROOT_TAB + }; + + register_callback ("start_unit", PLUGIN_REGISTER_GGC_ROOTS, NULL, + (void *)root); if (integer_type_node) { fake_var = build_decl (UNKNOWN_LOCATION, VAR_DECL, get_identifier ("_fake_var_"), -- 2.30.2