From 9e34db2e031f28f7cc622b6955c241b47bbc081e Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 11 Jul 2016 14:39:14 +0000 Subject: Support running the selftests under valgrind gcc/ChangeLog: * Makefile.in (selftest-valgrind): New phony target. * function-tests.c (selftest::build_cfg): Delete pass instances created by the test. (selftest::convert_to_ssa): Likewise. (selftest::test_expansion_to_rtl): Likewise. * tree-cfg.c (selftest::test_linear_chain): Release dominator vectors. (selftest::test_diamond): Likewise. From-SVN: r238209 --- gcc/function-tests.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/function-tests.c') diff --git a/gcc/function-tests.c b/gcc/function-tests.c index c8188e769fa..edd355fa153 100644 --- a/gcc/function-tests.c +++ b/gcc/function-tests.c @@ -296,6 +296,7 @@ build_cfg (tree fndecl) push_cfun (fun); lower_cf_pass->execute (fun); pop_cfun (); + delete lower_cf_pass; /* We can now convert to CFG form; for our trivial test function this gives us: @@ -310,6 +311,7 @@ build_cfg (tree fndecl) push_cfun (fun); build_cfg_pass->execute (fun); pop_cfun (); + delete build_cfg_pass; } /* Convert a gimple+CFG function to SSA form. */ @@ -325,6 +327,7 @@ convert_to_ssa (tree fndecl) push_cfun (fun); build_ssa_pass->execute (fun); pop_cfun (); + delete build_ssa_pass; } /* Assuming we have a simple 3-block CFG like this: @@ -594,6 +597,7 @@ test_expansion_to_rtl () init_function_start (fndecl); expand_pass->execute (fun); pop_cfun (); + delete expand_pass; /* On x86_64, I get this: (note 3 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) -- cgit v1.2.1